Submission #1324338

#TimeUsernameProblemLanguageResultExecution timeMemory
1324338quollcucumber`Ancient Machine 2 (JOI23_ancient2)C++20
Compilation error
0 ms0 KiB
using namespace std;

#include "ancient2.h"

//IDK why my code is getting runtime error

compile error
std::string Solve(int N) {
    std::string s;
    for(int i = 0; i < N; i++) {
        std::vector<int> a;
        std::vector<int> b;
        for(int j = 0; j < 1000; j++) a.push_back(j);
        for(int j = 0; j < 1000; j++) b.push_back(j);
        if(i < 998) {
            a[i] = 998;
            b[i] = 999;
            for(int j = 0; j < i; j++) {
                a[j] = j+1;
                b[j] = j+1;
            }
            if(Query(1000, a, b) == 998) {
                s.push_back('0');
            }else {
                s.push_back('1');
            }
        }else {
            a[i] = 0;
            b[i] = 1;
            for(int j = 0; j < i; j++) {
                a[j] = j+1;
                b[j] = j+1;
            }
            if(Query(1000, a, b) == 0) {
                s.push_back('0');
            }else {
                s.push_back('1');
            }
        }
    }
    return s;
}

Compilation message (stderr)

ancient2.cpp:7:1: error: 'compile' does not name a type
    7 | compile error
      | ^~~~~~~