Submission #1229510

#TimeUsernameProblemLanguageResultExecution timeMemory
1229510LaMatematica14Inside information (BOI21_servers)C++20
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
using namespace std;

int main() {
    ios_base::sync_with_stdio(0); cint.tie(NULL); cout.tie(NULL);

    int N, K; cin >> N >> K;
    vector<set<int>> num(N);
    for (int i = 0; i < N; i++) num[i].insert(i);
    for (int i = 0; i < K+N-1; i++) {
        char t; cin >> t;
        if (t == 'S') {
            int a, b; cin >> a >> b;
            if (num[a].size() > num[b].size()) swap(a, b);
            for (int x : num[a]) num[b].insert(x);
            num[a] = num[b];
        }
        else if (t == 'Q') {
            cin >> a >> d;
            cout << (num[a].count(d) ? "yes" : "no") << "\n";
        }
        else cout << "1\n";
    }
}

Compilation message (stderr)

servers.cpp: In function 'int main()':
servers.cpp:5:35: error: 'cint' was not declared in this scope; did you mean 'uint'?
    5 |     ios_base::sync_with_stdio(0); cint.tie(NULL); cout.tie(NULL);
      |                                   ^~~~
      |                                   uint
servers.cpp:19:20: error: 'a' was not declared in this scope
   19 |             cin >> a >> d;
      |                    ^
servers.cpp:19:25: error: 'd' was not declared in this scope
   19 |             cin >> a >> d;
      |                         ^