Submission #773871

# Submission time Handle Problem Language Result Execution time Memory
773871 2023-07-05T09:13:46 Z vjudge1 Zagrade (COI20_zagrade) C++17
0 / 100
1 ms 208 KB
#include <bits/stdc++.h>
using namespace std;
//#define int long long
//#define cout cout.flush()
#define faster ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);

int sor(int x,int y){
    cout<<"?"<<" "<<x<<" "<<y;
    cout<<endl;
    int m;cin>>m;
    cout<<endl;
    return m;
}

int main(){
    faster
    int n,k;cin>>n>>k;
    cout<<endl;
    vector <int> q;
    char dizi[n+1];
    dizi[1]='(';
    q.emplace_back(1);
    for(int i=2;i<=n;i++){
        if(q.size() && sor(q.back(),i)){
            dizi[i]=')';
            q.pop_back();
        }
        else{
            dizi[i]='(';
            q.emplace_back(i);
        }
    }//1-3 subtasks
    int gec=q.size()/2;
    for(int i=0;i<=gec-1;i++){
        dizi[q[i]]=')';
    }//2-4 subtasks

    cout<<"!";
    for(int i=1;i<=n;i++)cout<<" "<<dizi[i];
    cout<<endl;
    //return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 208 KB Answer length should be 2, but it is 1
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 208 KB Answer length should be 2, but it is 1
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 208 KB Answer length should be 4, but it is 1
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 208 KB Answer length should be 4, but it is 1
2 Halted 0 ms 0 KB -