184272025-10-22 13:32:31ubormaciSakktábla bábukkalcpp17Wrong answer 0/801ms568 KiB
#include <iostream>
#include <algorithm> // for sort, mainly
#include <vector>
#include <map>
#include <set>
#include <cmath>
#include <array>
#include <string>
#include <cstdio>
#include <iterator>
#include <unordered_set>
#include <cstdint> // for int64_t, int32_t, etc
#include <queue>
#include <stack>
#include <deque>
#include <numeric> // gcd, lcm
#include <fstream>
#include <bitset> // for bitset
#include <iomanip>
#include <cassert> // for set with custom ordering
#include <type_traits> // for set with custom ordering
#include <utility> // for swap, forward, etc
using namespace std;

#pragma GCC optimize("O2")
// #pragma GCC optimize("O1","O2","O3","Ofast","unroll-loops")
//#pragma GCC target("sse","sse2","sse3","sse4.1","sse4.2","avx","avx2","fma")

template<typename A, typename B> ostream& operator<<(ostream &os, const pair<A, B> &p) { return os << '(' << p.first << ", " << p.second << ')'; }
template<typename T_container, typename T = typename enable_if<!is_same<T_container, string>::value, typename T_container::value_type>::type> ostream& operator<<(ostream &os, const T_container &v) { os << '{'; string sep; for (const T &x : v) os << sep << x, sep = ", "; return os << '}'; }
void dbg_out() { cout << endl; }
template<typename Head, typename... Tail> void dbg_out(Head H, Tail... T) { cout << ' ' << H; dbg_out(T...); }
#ifdef LOCAL
#define dbg(...) cout << "(" << #__VA_ARGS__ << "):", dbg_out(__VA_ARGS__)
#else
#define dbg(...)
#endif

/*
 *
 * notes:
 *
 * int64_t
 * stoi(string s) -> string to int
 * to_string() -> int (or else) to string
 *
 * vector declaration:
 * vector<ll> v(n, 0)
 * vector<vector<ll>> v(n, vector<ll>(n, 0));
 *
 * {if statement} ? {truth value} : {false value}
 *
 * set lower bound/upper bound:
 * 	// . . . m1 . . . d . . . . m2
 *    auto m1_it = b.lower_bound(d);
 *    advance(m1_it, -1);
 *    m1 = *m1_it;
 *	m2 = *b.upper_bound(d);
 *
 * #ifdef LOCAL
 *    freopen("in.txt","r",stdin);
 *    freopen("out.txt","w",stdout);
 * #endif
 *
 * constexpr auto lcm(auto x, auto... xs)
 * {
 *	return ((x = std::lcm(x, xs)), ...);
 * }
 *
 * std::gcd(int a, int b)
 *
 * cout << setprecision(n);
 *
 * set with custom ordering
 * set<ll, decltype(&cmp)> qu(cmp);
 *
 */

typedef int64_t ll;

bool ins(ll i, ll j, ll n, ll m) {

    if(i < 0 || j < 0 || i >= n || j >= m) {
        return false;
    }
    return true;

}

void solve() {

    vector<string> v(8, "");
    ll n = 8;
    for(ll i = 0; i < n; i++) {
        cin >> v[i];
    }

    //cerr << "\nv=" << v;

    vector<pair<ll,ll>> dir = {{-1, 0}, {1, 0}, {0, 1}, {0, -1}};
    for(ll i = 0; i < n; i++) {
        for(ll j = 0; j < n; j++) {
            
            if(v[i][j] == 'F') {
                continue;
            }

            if((i + j) % 2 == 0 && v[i][j] != 'S') {
                cout << "LEHETETLEN";
                return;
            }
            else if((i + j) % 2 == 1 && v[i][j] != 'V') {
                cout << "LEHETETLEN";
                return;
            }

            for(const auto & [di, dj] : dir) {

                if(ins(i + di, j + dj, n, n) && v[i + di][j + dj] == v[i][j])
                {
                    cout << "LEHETETLEN";
                    return;
                }
            }

        }
    }

    cout << "LEHETSEGES";

}

int main()
{
    std::ios_base::sync_with_stdio(false);
    //cin.tie(nullptr);
    //cout.tie(nullptr);

    solve();

    return 0;
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted1ms316 KiB
2Accepted1ms316 KiB
subtask20/16
3Wrong answer1ms316 KiB
4Accepted1ms508 KiB
5Accepted1ms316 KiB
6Accepted1ms316 KiB
7Accepted1ms316 KiB
8Accepted1ms316 KiB
9Accepted1ms316 KiB
10Accepted1ms316 KiB
subtask30/14
11Wrong answer1ms316 KiB
12Accepted1ms508 KiB
13Accepted1ms320 KiB
14Accepted1ms316 KiB
15Accepted1ms316 KiB
16Accepted1ms316 KiB
17Accepted1ms316 KiB
18Accepted1ms316 KiB
subtask40/22
19Wrong answer1ms316 KiB
20Wrong answer1ms316 KiB
21Wrong answer1ms316 KiB
22Accepted1ms568 KiB
23Accepted1ms380 KiB
24Accepted1ms316 KiB
25Accepted1ms380 KiB
26Accepted1ms316 KiB
27Accepted1ms316 KiB
28Accepted1ms316 KiB
subtask50/28
29Accepted1ms316 KiB
30Accepted1ms508 KiB
31Wrong answer1ms316 KiB
32Accepted1ms508 KiB
33Accepted1ms316 KiB
34Accepted1ms316 KiB
35Accepted1ms316 KiB
36Accepted1ms316 KiB
37Accepted1ms316 KiB
38Accepted1ms316 KiB
39Wrong answer1ms316 KiB
40Accepted1ms508 KiB
41Accepted1ms320 KiB
42Accepted1ms316 KiB
43Accepted1ms316 KiB
44Accepted1ms316 KiB
45Accepted1ms316 KiB
46Accepted1ms316 KiB
47Wrong answer1ms316 KiB
48Wrong answer1ms316 KiB
49Wrong answer1ms316 KiB
50Accepted1ms568 KiB
51Accepted1ms380 KiB
52Accepted1ms316 KiB
53Accepted1ms380 KiB
54Accepted1ms316 KiB
55Accepted1ms316 KiB
56Accepted1ms316 KiB
57Accepted1ms316 KiB
58Wrong answer1ms372 KiB
59Accepted1ms316 KiB
60Wrong answer1ms316 KiB
61Accepted1ms316 KiB
62Wrong answer1ms500 KiB
63Accepted1ms500 KiB
64Wrong answer1ms316 KiB
65Accepted1ms316 KiB
66Wrong answer1ms552 KiB
67Accepted1ms316 KiB
68Accepted1ms316 KiB
69Accepted1ms316 KiB
70Accepted1ms316 KiB
71Accepted1ms316 KiB
72Accepted1ms316 KiB
73Accepted1ms316 KiB