Submission #899169

# Submission time Handle Problem Language Result Execution time Memory
899169 2024-01-05T14:36:13 Z AIF_is_carving Inside information (BOI21_servers) C++17
0 / 100
26 ms 860 KB
#include <bits/stdc++.h>
typedef long long ll;

using namespace std;



const int N=2e5+5;
map<int, int> graph;
int cnt[N];


//vector<int> graph2[N];

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);


 
    int n, k; cin>>n>>k;


    int count=1;

    for(int i=0; i<n+k-1; i++){
        char c; cin>>c;
        if(c=='S'){
            count+=1;
            int u, v; cin>>u>>v;
            graph[max(u,v)]=count;
        }
        else if(c=='Q'){
            //cout<<'Q'<<" ";
            int v, chunk; cin>>v>>chunk;
            if(graph[v]>=graph[chunk]) cout<<"yes"<<"\n";
            else cout<<"no"<<"\n";


        }
        else{

            int chunk; cin>>chunk;
            if(chunk==1) cout<<graph.size()<<"\n";
            else cout<<graph.size()-graph[chunk]+2<<"\n";
        }
    }

    return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 21 ms 860 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 21 ms 860 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 21 ms 860 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 21 ms 860 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 20 ms 836 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 20 ms 836 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 21 ms 860 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 21 ms 860 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 20 ms 832 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 20 ms 832 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 26 ms 860 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 26 ms 860 KB Output isn't correct
2 Halted 0 ms 0 KB -