Submission #1045512

# Submission time Handle Problem Language Result Execution time Memory
1045512 2024-08-06T04:41:45 Z 변재우(#11018) Ancient Machine 2 (JOI23_ancient2) C++17
0 / 100
82 ms 688 KB
#include "ancient2.h"
#include <bits/stdc++.h>
using namespace std;

const int M=1002;

string Solve(int N) {
  int a=0, b=0;
  string ret;
  for(int i=0; i<N; i++) {
    vector<int> X(M, 0), Y(M, 0);
    for(int j=0; j<M; j++) X[j]=j, Y[j]=j;
    if(ret.empty() || ret.back()=='1') {
      for(int i=0; i<b; i++) Y[i]=i+1;
      X[b]=M-1, Y[b]=M-2;
    }
    else {
      for(int i=0; i<a; i++) X[i]=i+1;
      X[a]=M-1, Y[a]=M-2;
    }
    if(Query(M, X, Y)==M-1) a++, ret+='0';
    else b++, ret+='1';
  }
  cout<<ret<<"\n";
  return ret;
}
# Verdict Execution time Memory Grader output
1 Incorrect 82 ms 688 KB Wrong Answer [1]
2 Halted 0 ms 0 KB -