제출 #869394

#제출 시각아이디문제언어결과실행 시간메모리
869394irmuunAncient Machine 2 (JOI23_ancient2)C++17
10 / 100
80 ms1788 KiB
#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){
            ans+='0';
        }
        else{
            ans+='1';
        }
        a.insert(a.begin(),0);
        b.insert(b.begin(),0);
        for(auto &x:a){
            x++;
        }
        for(auto &x:b){
            x++;
        }
        m++;
    }
    return ans;
}
#Verdict Execution timeMemoryGrader output
Fetching results...