제출 #1228400

#제출 시각아이디문제언어결과실행 시간메모리
1228400SpyrosAlivAncient Machine 2 (JOI23_ancient2)C++20
0 / 100
0 ms320 KiB
#include "ancient2.h"
#include <bits/stdc++.h>
using namespace std;

string Solve(int N) {
    vector<int> a, b;
    int m = 1002;
    for (int i = 0; i < m; i++) {
        a.push_back(i+1);
        b.push_back(i+1);
    }
    a.back() = m-1;
    b.back() = m-1;
    string s = "";
    for (int i = 0; i < N; i++) {
        b[i] = 1001;
        int fin = Query(m, a, b);
        if (fin == 1001) {
            s += '1';
        }
        else s += '0';
        b[i] = i+1;
    }
    return s;
}
#Verdict Execution timeMemoryGrader output
Fetching results...