184252025-10-22 13:29:13ubormaciSakktábla bábukkalcpp17Wrong answer 0/801ms616 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;
            }

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

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

        }
    }

    cout << "LEHETSEGES";

}

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

    solve();

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