Submission #1026029

# Submission time Handle Problem Language Result Execution time Memory
1026029 2024-07-17T13:00:07 Z 12345678 Inside information (BOI21_servers) C++17
5 / 100
1140 ms 64916 KB
#include <bits/stdc++.h>

using namespace std;

const int nx=4e3+5;

int n, k, vs[nx][nx], a, b;
char t;

int main()
{
    cin.tie(NULL)->sync_with_stdio(false);
    cin>>n>>k;
    for (int i=1; i<=n; i++) vs[i][i]=i;
    for (int i=1; i<n+k; i++)
    {
        cin>>t;
        if (t=='S')
        {
            cin>>a>>b;
            for (int j=1; j<=n; j++) vs[a][j]=vs[b][j]=(vs[a][j]||vs[b][j]);
        }
        if (t=='Q') cin>>a>>b, cout<<(vs[a][b]?"yes\n":"no\n");
        if (t=='C')
        {
            cin>>a;
            int cnt=0;
            for (int j=1; j<=n; j++) if (vs[j][a]) cnt++;
            cout<<cnt<<'\n';
        }
    }
}
# Verdict Execution time Memory Grader output
1 Correct 12 ms 1880 KB Output is correct
2 Correct 62 ms 64864 KB Output is correct
3 Correct 60 ms 64916 KB Output is correct
4 Correct 70 ms 64852 KB Output is correct
5 Correct 64 ms 64852 KB Output is correct
6 Correct 64 ms 64876 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 12 ms 1880 KB Output is correct
2 Correct 62 ms 64864 KB Output is correct
3 Correct 60 ms 64916 KB Output is correct
4 Correct 70 ms 64852 KB Output is correct
5 Correct 64 ms 64852 KB Output is correct
6 Correct 64 ms 64876 KB Output is correct
7 Correct 12 ms 1884 KB Output is correct
8 Correct 1056 ms 64340 KB Output is correct
9 Correct 843 ms 64516 KB Output is correct
10 Correct 1120 ms 64312 KB Output is correct
11 Correct 1140 ms 64596 KB Output is correct
12 Correct 894 ms 64596 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 12 ms 1880 KB Output is correct
2 Runtime error 33 ms 33116 KB Execution killed with signal 11
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 12 ms 1880 KB Output is correct
2 Runtime error 33 ms 33116 KB Execution killed with signal 11
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 12 ms 1896 KB Output is correct
2 Runtime error 45 ms 33104 KB Execution killed with signal 11
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 12 ms 1896 KB Output is correct
2 Runtime error 45 ms 33104 KB Execution killed with signal 11
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 14 ms 1896 KB Output is correct
2 Runtime error 40 ms 33104 KB Execution killed with signal 11
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 14 ms 1896 KB Output is correct
2 Runtime error 40 ms 33104 KB Execution killed with signal 11
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 12 ms 1896 KB Output is correct
2 Runtime error 34 ms 33128 KB Execution killed with signal 11
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 12 ms 1896 KB Output is correct
2 Runtime error 34 ms 33128 KB Execution killed with signal 11
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 12 ms 1896 KB Output is correct
2 Correct 68 ms 64864 KB Output is correct
3 Correct 62 ms 64908 KB Output is correct
4 Correct 64 ms 64860 KB Output is correct
5 Correct 63 ms 64820 KB Output is correct
6 Correct 67 ms 64860 KB Output is correct
7 Correct 31 ms 1884 KB Output is correct
8 Runtime error 36 ms 33128 KB Execution killed with signal 11
9 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 12 ms 1896 KB Output is correct
2 Correct 68 ms 64864 KB Output is correct
3 Correct 62 ms 64908 KB Output is correct
4 Correct 64 ms 64860 KB Output is correct
5 Correct 63 ms 64820 KB Output is correct
6 Correct 67 ms 64860 KB Output is correct
7 Correct 31 ms 1884 KB Output is correct
8 Runtime error 36 ms 33128 KB Execution killed with signal 11
9 Halted 0 ms 0 KB -