185262025-10-25 19:38:05szabelrSakktábla bábukkalcpp17Accepted 80/801ms628 KiB
// sakktabla1.cpp : This file contains the 'main' function. Program execution begins and ends there.
//

#include <iostream>
using namespace std;

int main()
{
    string  a = "0", b = "0";
    int lehete = 1;
    string q;
    string x;
    for (int i = 0; i <= 7; i++) {
            cin >> q;
            for (int y = 0; y <= 7; y++) {
                x = q[y];
                if (x != "F") {
                    if (i % 2 == 0 and y % 2 == 1) {
                        if (a == "0")
                            a = x;
                        else if (x != a)
                            lehete = 0;
                       
                    }
                    if (i % 2 == 1 and y % 2 == 1) {
                        if (b == "0" )
                            b = x;
                        else if (x != b)
                            lehete = 0;
                    }
                    if (i % 2 == 0 and y % 2 == 0) {
                        if (b == "0")
                            b = x;
                        else if (x != b)
                            lehete = 0;
                    }
                    if (i % 2 == 1 and y % 2 == 0) {
                        if (a == "0")
                            a = x;
                        else if (x != a)
                            lehete = 0;
                    }
                    if (a == b)
                        lehete = 0;
                }
            }       
    }
    if (lehete == 1)
        cout << "LEHETSEGES";
    else
        cout << "LEHETETLEN";
}

// Run program: Ctrl + F5 or Debug > Start Without Debugging menu
// Debug program: F5 or Debug > Start Debugging menu

// Tips for Getting Started: 
//   1. Use the Solution Explorer window to add/manage files
//   2. Use the Team Explorer window to connect to source control
//   3. Use the Output window to see build output and other messages
//   4. Use the Error List window to view errors
//   5. Go to Project > Add New Item to create new code files, or Project > Add Existing Item to add existing code files to the project
//   6. In the future, to open this project again, go to File > Open > Project and select the .sln file
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted1ms316 KiB
2Accepted1ms316 KiB
subtask216/16
3Accepted1ms316 KiB
4Accepted1ms316 KiB
5Accepted1ms316 KiB
6Accepted1ms316 KiB
7Accepted1ms316 KiB
8Accepted1ms508 KiB
9Accepted1ms316 KiB
10Accepted1ms316 KiB
subtask314/14
11Accepted1ms316 KiB
12Accepted1ms316 KiB
13Accepted1ms316 KiB
14Accepted1ms316 KiB
15Accepted1ms320 KiB
16Accepted1ms316 KiB
17Accepted1ms316 KiB
18Accepted1ms316 KiB
subtask422/22
19Accepted1ms316 KiB
20Accepted1ms316 KiB
21Accepted1ms508 KiB
22Accepted1ms316 KiB
23Accepted1ms316 KiB
24Accepted1ms316 KiB
25Accepted1ms320 KiB
26Accepted1ms316 KiB
27Accepted1ms316 KiB
28Accepted1ms316 KiB
subtask528/28
29Accepted1ms316 KiB
30Accepted1ms316 KiB
31Accepted1ms316 KiB
32Accepted1ms316 KiB
33Accepted1ms316 KiB
34Accepted1ms316 KiB
35Accepted1ms316 KiB
36Accepted1ms508 KiB
37Accepted1ms316 KiB
38Accepted1ms316 KiB
39Accepted1ms316 KiB
40Accepted1ms316 KiB
41Accepted1ms316 KiB
42Accepted1ms316 KiB
43Accepted1ms320 KiB
44Accepted1ms316 KiB
45Accepted1ms316 KiB
46Accepted1ms316 KiB
47Accepted1ms316 KiB
48Accepted1ms316 KiB
49Accepted1ms508 KiB
50Accepted1ms316 KiB
51Accepted1ms316 KiB
52Accepted1ms316 KiB
53Accepted1ms320 KiB
54Accepted1ms316 KiB
55Accepted1ms316 KiB
56Accepted1ms316 KiB
57Accepted1ms508 KiB
58Accepted1ms316 KiB
59Accepted1ms316 KiB
60Accepted1ms508 KiB
61Accepted1ms316 KiB
62Accepted1ms628 KiB
63Accepted1ms316 KiB
64Accepted1ms316 KiB
65Accepted1ms316 KiB
66Accepted1ms316 KiB
67Accepted1ms316 KiB
68Accepted1ms508 KiB
69Accepted1ms316 KiB
70Accepted1ms376 KiB
71Accepted1ms316 KiB
72Accepted1ms316 KiB
73Accepted1ms316 KiB