Submission #780740

# Submission time Handle Problem Language Result Execution time Memory
780740 2023-07-12T12:32:18 Z christinelynn Zagrade (COI20_zagrade) C++17
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll n,q;
char ans[200005];
ll jumopen,jumclose;
int main(){
    cin>>n>>q;
    ll x=2;
    vector <ll> tumpuk;
    for (int i=1;i<=n;i++) ans[i]=' ';
    tumpuk.push_back(1);
    ll y;
    for (int i=2;i<=n;i++){
        cout<<">>> ? "<<tumpuk[tumpuk.size()-1]<<" "<<i<<endl;
        fflush(stdout);
        cin>>y;
        if (tumpuk.emtpy()){
            tumpuk.push_back(i);
            continue;
        }
        if (y==0){
            tumpuk.push_back(i);
        }
        else{
            ans[tumpuk[tumpuk.size()-1]]='(';
            ans[i]=')';
            jumopen++;
            jumclose++;
            tumpuk.pop_back();
        }
    }
    ll u=n/2-jumopen;
    cout<<">>> ! ";
    fflush(stdout);
    for (int i=1;i<=n;i++){
        if (ans[i]!=' ') cout<<ans[i];
        else if (u!=0){
            cout<<")";
            fflush(stdout);
            u--;
        }
        else{
            cout<<"(";
            fflush(stdout);
        }
    }
}

Compilation message

zagrade.cpp: In function 'int main()':
zagrade.cpp:18:20: error: 'class std::vector<long long int>' has no member named 'emtpy'; did you mean 'empty'?
   18 |         if (tumpuk.emtpy()){
      |                    ^~~~~
      |                    empty
zagrade.cpp:9:8: warning: unused variable 'x' [-Wunused-variable]
    9 |     ll x=2;
      |        ^