# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
639656 | 2022-09-10T21:16:43 Z | Benmath | Inside information (BOI21_servers) | C++14 | 396 ms | 4888 KB |
#include <bits/stdc++.h> using namespace std; int main() { int n,k; cin>>n>>k; int brojac=1; int par[n+1]; int par1[n+1]; for(int i=0;i<=n;i++){ par[i]=-1; par1[i]=-1; } for(int k1=0;k1<(n+k-1);k1++){ char l; cin>>l; if(l=='S'){ int x,y; cin>>x>>y; if(x>y){ swap(x,y); } par[y]=x; par1[y]=brojac; brojac++; }else if(l=='Q'){ int y,x; cin>>y>>x; if(x==y){ cout<<"yes"<<endl; }else{ map<int,int>mapa; int ro=-1; int t1=0; while(x>0){ mapa[x]=ro; if(par1[x]<ro or par1[x]==-1){ break; }else{ ro=par1[x]; x=x/2; } } ro=1e9; while(y>0){ if(mapa[y]!=0){ if(mapa[y]<ro){ t1++; } break; } if(par1[y]>ro or par1[y]==-1){ break; }else{ ro=par1[y]; y=y/2; } } if(t1>0){ cout<<"yes"<<endl; }else{ cout<<"no"<<endl; } } }else{ } } }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 206 ms | 1484 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 206 ms | 1484 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 211 ms | 1500 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 211 ms | 1500 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 214 ms | 1496 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 214 ms | 1496 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 216 ms | 1640 KB | Output is correct |
2 | Correct | 396 ms | 4852 KB | Output is correct |
3 | Correct | 340 ms | 4888 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 216 ms | 1640 KB | Output is correct |
2 | Correct | 396 ms | 4852 KB | Output is correct |
3 | Correct | 340 ms | 4888 KB | Output is correct |
4 | Incorrect | 192 ms | 1528 KB | Extra information in the output file |
5 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 204 ms | 1476 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 204 ms | 1476 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 222 ms | 1576 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 222 ms | 1576 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |