# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
1003912 |
2024-06-20T19:51:25 Z |
vjudge1 |
Zagrade (COI20_zagrade) |
C++17 |
|
1 ms |
1112 KB |
#include <bits/stdc++.h>
using namespace std;
vector<int> v;
stack<int> st;
int main(){
int n,q; cin>>n>>q;
v.resize(n+5);
st.push(1); v[1] = 1;
for(int i = 2; i <= n; i++){
cout<<"? "<<st.top()<<" "<<i<<"\n"<<flush;
int x; cin>>x;
if(x == 0){
v[i] = 1;
st.push(i);
}else{
v[i] = 0;
st.pop();
}
}
cout<<"! ";
for(int i = 1; i <= n; i++){
if(v[i] == 0)cout<<")";
else cout<<"(";
}cout<<"\n"<<flush;
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Runtime error |
0 ms |
344 KB |
Execution killed with signal 11 |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Mismatch at position 1. Expected ), found ( |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Runtime error |
1 ms |
1112 KB |
Execution killed with signal 11 |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Mismatch at position 1. Expected ), found ( |
2 |
Halted |
0 ms |
0 KB |
- |