Submission #869390

# Submission time Handle Problem Language Result Execution time Memory
869390 2023-11-04T09:05:42 Z irmuun Ancient Machine 2 (JOI23_ancient2) C++17
Compilation error
0 ms 0 KB
#include<bits/stdc++.h>
#include "ancient2.h"

using namespace std;
 
#define ll long long
#define pb push_back
#define ff first
#define ss second
#define all(s) s.begin(),s.end()
#define rall(s) s.rbegin(),s.rend()

string Solve(int n){
    vector<int>a={1,1,2},b={2,1,2};
    string ans="";
    int m=3;
    for(int i=0;i<n;i++){
        int q=Query(m,a,b);
        if(q==i+1){
            s+='0';
        }
        else{
            s+='1';
        }
        a.insert(a.begin(),0);
        b.insert(b.begin(),0);
        for(auto &x:a){
            x++;
        }
        for(auto &x:b){
            x++;
        }
    }
    return s;
}

Compilation message

ancient2.cpp: In function 'std::string Solve(int)':
ancient2.cpp:20:13: error: 's' was not declared in this scope
   20 |             s+='0';
      |             ^
ancient2.cpp:23:13: error: 's' was not declared in this scope
   23 |             s+='1';
      |             ^
ancient2.cpp:34:12: error: 's' was not declared in this scope
   34 |     return s;
      |            ^