Submission #92187

#TimeUsernameProblemLanguageResultExecution timeMemory
92187faishol27Carnival (CEOI14_carnival)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std;  #define pub push_back  int n, now, bef = 1; int ans[155]; vector<int>q;  int main(){   cin >> n;      ans[1] = 1;   q.pub(1);   for(int i=2;i<=n;i++){    cout << q.size()+1;    for(int elm:q)     cout << " " << elm;    cout << " " << i << endl << flush;        cin >> now;    if(now != bef){     q.pub(i);     ans[i] = now;    }else{     int akar = sqrt((double)bef)+1,      frn = -1,      sz = q.size();           int le = 0,      ri = min(le+akar-1, sz-1);     while(frn == -1){      cout << abs(le-ri)+2;      for(int j=le;j<=ri;j++)       cout << " " << j;      cout << " " << i << endl << flush;            int resp;      cin >> resp;            if(resp == abs(le-ri)+1){       for(int j=le;j<=ri && frn == -1;j++){        cout << "2 " << j << " " << i << endl << flush;        int tmp;        cin >> tmp;        if(tmp == 1) frn = j;       }      }            le = ri+1;      ri = min(le+akar-1, sz-1);     }          ans[i] = ans[frn];    }        swap(now, bef);   }      cout << 0;   for(int i=1;i<=n;i++)    cout << " " << ans[i];   cout << endl << flush; }

Compilation message (stderr)

carnival.cpp:2:21: error: stray '\302' in program
 using namespace std; 
                     ^
carnival.cpp:2:22: error: stray '\240' in program
 using namespace std; 
                      ^
carnival.cpp:6:14: error: stray '\302' in program
 vector<int>q; 
              ^
carnival.cpp:6:15: error: stray '\240' in program
 vector<int>q; 
               ^
carnival.cpp:7:12: error: stray '\302' in program
 int main(){   cin >> n;      ans[1] = 1;   q.pub(1);   for(int i=2;i<=n;i++){    cout << q.size()+1;    for(int elm:q)     cout << " " << elm;    cout << " " << i << endl << flush;        cin >> now;    if(now != bef){     q.pub(i);     ans[i] = now;    }else{     int akar = sqrt((double)bef)+1,      frn = -1,      sz = q.size();           int le = 0,      ri = min(le+akar-1, sz-1);     while(frn == -1){      cout << abs(le-ri)+2;      for(int j=le;j<=ri;j++)       cout << " " << j;      cout << " " << i << endl << flush;            int resp;      cin >> resp;            if(resp == abs(le-ri)+1){       for(int j=le;j<=ri && frn == -1;j++){        cout << "2 " << j << " " << i << endl << flush;        int tmp;        cin >> tmp;        if(tmp == 1) frn = j;       }      }            le = ri+1;      ri = min(le+akar-1, sz-1);     }          ans[i] = ans[frn];    }        swap(now, bef);   }      cout << 0;   for(int i=1;i<=n;i++)    cout << " " << ans[i];   cout << endl << flush;
            ^
carnival.cpp:7:13: error: stray '\240' in program
 int main(){   cin >> n;      ans[1] = 1;   q.pub(1);   for(int i=2;i<=n;i++){    cout << q.size()+1;    for(int elm:q)     cout << " " << elm;    cout << " " << i << endl << flush;        cin >> now;    if(now != bef){     q.pub(i);     ans[i] = now;    }else{     int akar = sqrt((double)bef)+1,      frn = -1,      sz = q.size();           int le = 0,      ri = min(le+akar-1, sz-1);     while(frn == -1){      cout << abs(le-ri)+2;      for(int j=le;j<=ri;j++)       cout << " " << j;      cout << " " << i << endl << flush;            int resp;      cin >> resp;            if(resp == abs(le-ri)+1){       for(int j=le;j<=ri && frn == -1;j++){        cout << "2 " << j << " " << i << endl << flush;        int tmp;        cin >> tmp;        if(tmp == 1) frn = j;       }      }            le = ri+1;      ri = min(le+akar-1, sz-1);     }          ans[i] = ans[frn];    }        swap(now, bef);   }      cout << 0;   for(int i=1;i<=n;i++)    cout << " " << ans[i];   cout << endl << flush;
             ^
carnival.cpp:7:14: error: stray '\302' in program
 int main(){   cin >> n;      ans[1] = 1;   q.pub(1);   for(int i=2;i<=n;i++){    cout << q.size()+1;    for(int elm:q)     cout << " " << elm;    cout << " " << i << endl << flush;        cin >> now;    if(now != bef){     q.pub(i);     ans[i] = now;    }else{     int akar = sqrt((double)bef)+1,      frn = -1,      sz = q.size();           int le = 0,      ri = min(le+akar-1, sz-1);     while(frn == -1){      cout << abs(le-ri)+2;      for(int j=le;j<=ri;j++)       cout << " " << j;      cout << " " << i << endl << flush;            int resp;      cin >> resp;            if(resp == abs(le-ri)+1){       for(int j=le;j<=ri && frn == -1;j++){        cout << "2 " << j << " " << i << endl << flush;        int tmp;        cin >> tmp;        if(tmp == 1) frn = j;       }      }            le = ri+1;      ri = min(le+akar-1, sz-1);     }          ans[i] = ans[frn];    }        swap(now, bef);   }      cout << 0;   for(int i=1;i<=n;i++)    cout << " " << ans[i];   cout << endl << flush;
              ^
carnival.cpp:7:15: error: stray '\240' in program
 int main(){   cin >> n;      ans[1] = 1;   q.pub(1);   for(int i=2;i<=n;i++){    cout << q.size()+1;    for(int elm:q)     cout << " " << elm;    cout << " " << i << endl << flush;        cin >> now;    if(now != bef){     q.pub(i);     ans[i] = now;    }else{     int akar = sqrt((double)bef)+1,      frn = -1,      sz = q.size();           int le = 0,      ri = min(le+akar-1, sz-1);     while(frn == -1){      cout << abs(le-ri)+2;      for(int j=le;j<=ri;j++)       cout << " " << j;      cout << " " << i << endl << flush;            int resp;      cin >> resp;            if(resp == abs(le-ri)+1){       for(int j=le;j<=ri && frn == -1;j++){        cout << "2 " << j << " " << i << endl << flush;        int tmp;        cin >> tmp;        if(tmp == 1) frn = j;       }      }            le = ri+1;      ri = min(le+akar-1, sz-1);     }          ans[i] = ans[frn];    }        swap(now, bef);   }      cout << 0;   for(int i=1;i<=n;i++)    cout << " " << ans[i];   cout << endl << flush;
               ^
carnival.cpp:7:26: error: stray '\302' in program
 int main(){   cin >> n;      ans[1] = 1;   q.pub(1);   for(int i=2;i<=n;i++){    cout << q.size()+1;    for(int elm:q)     cout << " " << elm;    cout << " " << i << endl << flush;        cin >> now;    if(now != bef){     q.pub(i);     ans[i] = now;    }else{     int akar = sqrt((double)bef)+1,      frn = -1,      sz = q.size();           int le = 0,      ri = min(le+akar-1, sz-1);     while(frn == -1){      cout << abs(le-ri)+2;      for(int j=le;j<=ri;j++)       cout << " " << j;      cout << " " << i << endl << flush;            int resp;      cin >> resp;            if(resp == abs(le-ri)+1){       for(int j=le;j<=ri && frn == -1;j++){        cout << "2 " << j << " " << i << endl << flush;        int tmp;        cin >> tmp;        if(tmp == 1) frn = j;       }      }            le = ri+1;      ri = min(le+akar-1, sz-1);     }          ans[i] = ans[frn];    }        swap(now, bef);   }      cout << 0;   for(int i=1;i<=n;i++)    cout << " " << ans[i];   cout << endl << flush;
                          ^
carnival.cpp:7:27: error: stray '\240' in program
 int main(){   cin >> n;      ans[1] = 1;   q.pub(1);   for(int i=2;i<=n;i++){    cout << q.size()+1;    for(int elm:q)     cout << " " << elm;    cout << " " << i << endl << flush;        cin >> now;    if(now != bef){     q.pub(i);     ans[i] = now;    }else{     int akar = sqrt((double)bef)+1,      frn = -1,      sz = q.size();           int le = 0,      ri = min(le+akar-1, sz-1);     while(frn == -1){      cout << abs(le-ri)+2;      for(int j=le;j<=ri;j++)       cout << " " << j;      cout << " " << i << endl << flush;            int resp;      cin >> resp;            if(resp == abs(le-ri)+1){       for(int j=le;j<=ri && frn == -1;j++){        cout << "2 " << j << " " << i << endl << flush;        int tmp;        cin >> tmp;        if(tmp == 1) frn = j;       }      }            le = ri+1;      ri = min(le+akar-1, sz-1);     }          ans[i] = ans[frn];    }        swap(now, bef);   }      cout << 0;   for(int i=1;i<=n;i++)    cout << " " << ans[i];   cout << endl << flush;
                           ^
carnival.cpp:7:28: error: stray '\302' in program
 int main(){   cin >> n;      ans[1] = 1;   q.pub(1);   for(int i=2;i<=n;i++){    cout << q.size()+1;    for(int elm:q)     cout << " " << elm;    cout << " " << i << endl << flush;        cin >> now;    if(now != bef){     q.pub(i);     ans[i] = now;    }else{     int akar = sqrt((double)bef)+1,      frn = -1,      sz = q.size();           int le = 0,      ri = min(le+akar-1, sz-1);     while(frn == -1){      cout << abs(le-ri)+2;      for(int j=le;j<=ri;j++)       cout << " " << j;      cout << " " << i << endl << flush;            int resp;      cin >> resp;            if(resp == abs(le-ri)+1){       for(int j=le;j<=ri && frn == -1;j++){        cout << "2 " << j << " " << i << endl << flush;        int tmp;        cin >> tmp;        if(tmp == 1) frn = j;       }      }            le = ri+1;      ri = min(le+akar-1, sz-1);     }          ans[i] = ans[frn];    }        swap(now, bef);   }      cout << 0;   for(int i=1;i<=n;i++)    cout << " " << ans[i];   cout << endl << flush;
                            ^
carnival.cpp:7:29: error: stray '\240' in program
 int main(){   cin >> n;      ans[1] = 1;   q.pub(1);   for(int i=2;i<=n;i++){    cout << q.size()+1;    for(int elm:q)     cout << " " << elm;    cout << " " << i << endl << flush;        cin >> now;    if(now != bef){     q.pub(i);     ans[i] = now;    }else{     int akar = sqrt((double)bef)+1,      frn = -1,      sz = q.size();           int le = 0,      ri = min(le+akar-1, sz-1);     while(frn == -1){      cout << abs(le-ri)+2;      for(int j=le;j<=ri;j++)       cout << " " << j;      cout << " " << i << endl << flush;            int resp;      cin >> resp;            if(resp == abs(le-ri)+1){       for(int j=le;j<=ri && frn == -1;j++){        cout << "2 " << j << " " << i << endl << flush;        int tmp;        cin >> tmp;        if(tmp == 1) frn = j;       }      }            le = ri+1;      ri = min(le+akar-1, sz-1);     }          ans[i] = ans[frn];    }        swap(now, bef);   }      cout << 0;   for(int i=1;i<=n;i++)    cout << " " << ans[i];   cout << endl << flush;
                             ^
carnival.cpp:7:30: error: stray '\302' in program
 int main(){   cin >> n;      ans[1] = 1;   q.pub(1);   for(int i=2;i<=n;i++){    cout << q.size()+1;    for(int elm:q)     cout << " " << elm;    cout << " " << i << endl << flush;        cin >> now;    if(now != bef){     q.pub(i);     ans[i] = now;    }else{     int akar = sqrt((double)bef)+1,      frn = -1,      sz = q.size();           int le = 0,      ri = min(le+akar-1, sz-1);     while(frn == -1){      cout << abs(le-ri)+2;      for(int j=le;j<=ri;j++)       cout << " " << j;      cout << " " << i << endl << flush;            int resp;      cin >> resp;            if(resp == abs(le-ri)+1){       for(int j=le;j<=ri && frn == -1;j++){        cout << "2 " << j << " " << i << endl << flush;        int tmp;        cin >> tmp;        if(tmp == 1) frn = j;       }      }            le = ri+1;      ri = min(le+akar-1, sz-1);     }          ans[i] = ans[frn];    }        swap(now, bef);   }      cout << 0;   for(int i=1;i<=n;i++)    cout << " " << ans[i];   cout << endl << flush;
                              ^
carnival.cpp:7:31: error: stray '\240' in program
 int main(){   cin >> n;      ans[1] = 1;   q.pub(1);   for(int i=2;i<=n;i++){    cout << q.size()+1;    for(int elm:q)     cout << " " << elm;    cout << " " << i << endl << flush;        cin >> now;    if(now != bef){     q.pub(i);     ans[i] = now;    }else{     int akar = sqrt((double)bef)+1,      frn = -1,      sz = q.size();           int le = 0,      ri = min(le+akar-1, sz-1);     while(frn == -1){      cout << abs(le-ri)+2;      for(int j=le;j<=ri;j++)       cout << " " << j;      cout << " " << i << endl << flush;            int resp;      cin >> resp;            if(resp == abs(le-ri)+1){       for(int j=le;j<=ri && frn == -1;j++){        cout << "2 " << j << " " << i << endl << flush;        int tmp;        cin >> tmp;        if(tmp == 1) frn = j;       }      }            le = ri+1;      ri = min(le+akar-1, sz-1);     }          ans[i] = ans[frn];    }        swap(now, bef);   }      cout << 0;   for(int i=1;i<=n;i++)    cout << " " << ans[i];   cout << endl << flush;
                               ^
carnival.cpp:7:32: error: stray '\302' in program
 int main(){   cin >> n;      ans[1] = 1;   q.pub(1);   for(int i=2;i<=n;i++){    cout << q.size()+1;    for(int elm:q)     cout << " " << elm;    cout << " " << i << endl << flush;        cin >> now;    if(now != bef){     q.pub(i);     ans[i] = now;    }else{     int akar = sqrt((double)bef)+1,      frn = -1,      sz = q.size();           int le = 0,      ri = min(le+akar-1, sz-1);     while(frn == -1){      cout << abs(le-ri)+2;      for(int j=le;j<=ri;j++)       cout << " " << j;      cout << " " << i << endl << flush;            int resp;      cin >> resp;            if(resp == abs(le-ri)+1){       for(int j=le;j<=ri && frn == -1;j++){        cout << "2 " << j << " " << i << endl << flush;        int tmp;        cin >> tmp;        if(tmp == 1) frn = j;       }      }            le = ri+1;      ri = min(le+akar-1, sz-1);     }          ans[i] = ans[frn];    }        swap(now, bef);   }      cout << 0;   for(int i=1;i<=n;i++)    cout << " " << ans[i];   cout << endl << flush;
                                ^
carnival.cpp:7:33: error: stray '\240' in program
 int main(){   cin >> n;      ans[1] = 1;   q.pub(1);   for(int i=2;i<=n;i++){    cout << q.size()+1;    for(int elm:q)     cout << " " << elm;    cout << " " << i << endl << flush;        cin >> now;    if(now != bef){     q.pub(i);     ans[i] = now;    }else{     int akar = sqrt((double)bef)+1,      frn = -1,      sz = q.size();           int le = 0,      ri = min(le+akar-1, sz-1);     while(frn == -1){      cout << abs(le-ri)+2;      for(int j=le;j<=ri;j++)       cout << " " << j;      cout << " " << i << endl << flush;            int resp;      cin >> resp;            if(resp == abs(le-ri)+1){       for(int j=le;j<=ri && frn == -1;j++){        cout << "2 " << j << " " << i << endl << flush;        int tmp;        cin >> tmp;        if(tmp == 1) frn = j;       }      }            le = ri+1;      ri = min(le+akar-1, sz-1);     }          ans[i] = ans[frn];    }        swap(now, bef);   }      cout << 0;   for(int i=1;i<=n;i++)    cout << " " << ans[i];   cout << endl << flush;
                                 ^
carnival.cpp:7:34: error: stray '\302' in program
 int main(){   cin >> n;      ans[1] = 1;   q.pub(1);   for(int i=2;i<=n;i++){    cout << q.size()+1;    for(int elm:q)     cout << " " << elm;    cout << " " << i << endl << flush;        cin >> now;    if(now != bef){     q.pub(i);     ans[i] = now;    }else{     int akar = sqrt((double)bef)+1,      frn = -1,      sz = q.size();           int le = 0,      ri = min(le+akar-1, sz-1);     while(frn == -1){      cout << abs(le-ri)+2;      for(int j=le;j<=ri;j++)       cout << " " << j;      cout << " " << i << endl << flush;            int resp;      cin >> resp;            if(resp == abs(le-ri)+1){       for(int j=le;j<=ri && frn == -1;j++){        cout << "2 " << j << " " << i << endl << flush;        int tmp;        cin >> tmp;        if(tmp == 1) frn = j;       }      }            le = ri+1;      ri = min(le+akar-1, sz-1);     }          ans[i] = ans[frn];    }        swap(now, bef);   }      cout << 0;   for(int i=1;i<=n;i++)    cout << " " << ans[i];   cout << endl << flush;
                                  ^
carnival.cpp:7:35: error: stray '\240' in program
 int main(){   cin >> n;      ans[1] = 1;   q.pub(1);   for(int i=2;i<=n;i++){    cout << q.size()+1;    for(int elm:q)     cout << " " << elm;    cout << " " << i << endl << flush;        cin >> now;    if(now != bef){     q.pub(i);     ans[i] = now;    }else{     int akar = sqrt((double)bef)+1,      frn = -1,      sz = q.size();           int le = 0,      ri = min(le+akar-1, sz-1);     while(frn == -1){      cout << abs(le-ri)+2;      for(int j=le;j<=ri;j++)       cout << " " << j;      cout << " " << i << endl << flush;            int resp;      cin >> resp;            if(resp == abs(le-ri)+1){       for(int j=le;j<=ri && frn == -1;j++){        cout << "2 " << j << " " << i << endl << flush;        int tmp;        cin >> tmp;        if(tmp == 1) frn = j;       }      }            le = ri+1;      ri = min(le+akar-1, sz-1);     }          ans[i] = ans[frn];    }        swap(now, bef);   }      cout << 0;   for(int i=1;i<=n;i++)    cout << " " << ans[i];   cout << endl << flush;
                                   ^
carnival.cpp:7:48: error: stray '\302' in program
 int main(){   cin >> n;      ans[1] = 1;   q.pub(1);   for(int i=2;i<=n;i++){    cout << q.size()+1;    for(int elm:q)     cout << " " << elm;    cout << " " << i << endl << flush;        cin >> now;    if(now != bef){     q.pub(i);     ans[i] = now;    }else{     int akar = sqrt((double)bef)+1,      frn = -1,      sz = q.size();           int le = 0,      ri = min(le+akar-1, sz-1);     while(frn == -1){      cout << abs(le-ri)+2;      for(int j=le;j<=ri;j++)       cout << " " << j;      cout << " " << i << endl << flush;            int resp;      cin >> resp;            if(resp == abs(le-ri)+1){       for(int j=le;j<=ri && frn == -1;j++){        cout << "2 " << j << " " << i << endl << flush;        int tmp;        cin >> tmp;        if(tmp == 1) frn = j;       }      }            le = ri+1;      ri = min(le+akar-1, sz-1);     }          ans[i] = ans[frn];    }        swap(now, bef);   }      cout << 0;   for(int i=1;i<=n;i++)    cout << " " << ans[i];   cout << endl << flush;
                                                ^
carnival.cpp:7:49: error: stray '\240' in program
 int main(){   cin >> n;      ans[1] = 1;   q.pub(1);   for(int i=2;i<=n;i++){    cout << q.size()+1;    for(int elm:q)     cout << " " << elm;    cout << " " << i << endl << flush;        cin >> now;    if(now != bef){     q.pub(i);     ans[i] = now;    }else{     int akar = sqrt((double)bef)+1,      frn = -1,      sz = q.size();           int le = 0,      ri = min(le+akar-1, sz-1);     while(frn == -1){      cout << abs(le-ri)+2;      for(int j=le;j<=ri;j++)       cout << " " << j;      cout << " " << i << endl << flush;            int resp;      cin >> resp;            if(resp == abs(le-ri)+1){       for(int j=le;j<=ri && frn == -1;j++){        cout << "2 " << j << " " << i << endl << flush;        int tmp;        cin >> tmp;        if(tmp == 1) frn = j;       }      }            le = ri+1;      ri = min(le+akar-1, sz-1);     }          ans[i] = ans[frn];    }        swap(now, bef);   }      cout << 0;   for(int i=1;i<=n;i++)    cout << " " << ans[i];   cout << endl << flush;
                                                 ^
carnival.cpp:7:50: error: stray '\302' in program
 int main(){   cin >> n;      ans[1] = 1;   q.pub(1);   for(int i=2;i<=n;i++){    cout << q.size()+1;    for(int elm:q)     cout << " " << elm;    cout << " " << i << endl << flush;        cin >> now;    if(now != bef){     q.pub(i);     ans[i] = now;    }else{     int akar = sqrt((double)bef)+1,      frn = -1,      sz = q.size();           int le = 0,      ri = min(le+akar-1, sz-1);     while(frn == -1){      cout << abs(le-ri)+2;      for(int j=le;j<=ri;j++)       cout << " " << j;      cout << " " << i << endl << flush;            int resp;      cin >> resp;            if(resp == abs(le-ri)+1){       for(int j=le;j<=ri && frn == -1;j++){        cout << "2 " << j << " " << i << endl << flush;        int tmp;        cin >> tmp;        if(tmp == 1) frn = j;       }      }            le = ri+1;      ri = min(le+akar-1, sz-1);     }          ans[i] = ans[frn];    }        swap(now, bef);   }      cout << 0;   for(int i=1;i<=n;i++)    cout << " " << ans[i];   cout << endl << flush;
                                                  ^
carnival.cpp:7:51: error: stray '\240' in program
 int main(){   cin >> n;      ans[1] = 1;   q.pub(1);   for(int i=2;i<=n;i++){    cout << q.size()+1;    for(int elm:q)     cout << " " << elm;    cout << " " << i << endl << flush;        cin >> now;    if(now != bef){     q.pub(i);     ans[i] = now;    }else{     int akar = sqrt((double)bef)+1,      frn = -1,      sz = q.size();           int le = 0,      ri = min(le+akar-1, sz-1);     while(frn == -1){      cout << abs(le-ri)+2;      for(int j=le;j<=ri;j++)       cout << " " << j;      cout << " " << i << endl << flush;            int resp;      cin >> resp;            if(resp == abs(le-ri)+1){       for(int j=le;j<=ri && frn == -1;j++){        cout << "2 " << j << " " << i << endl << flush;