Submission #1092170

#TimeUsernameProblemLanguageResultExecution timeMemory
1092170onlk97Ancient Machine 2 (JOI23_ancient2)C++17
37 / 100
65 ms848 KiB
#include "ancient2.h" #include <string> #include <vector> #include <bits/stdc++.h> using namespace std; string Solve(int N){ string ans=""; for (int i=0; i<500; i++){ vector <int> a(i+3,0),b(i+3,0); for (int j=0; j<i+3; j++) a[j]=b[j]=j; for (int j=0; j<i; j++){ a[j]=j+1; b[j]=j+1; } a[i]=i+1; b[i]=i+2; int tp=Query(i+3,a,b); if (tp==i+1) ans+='0'; else ans+='1'; } for (int i=0; i<500; i++){ vector <int> a(501,0),b(501,0); for (int j=0; j<500; j++) a[j]=b[j]=(j+1)%500; a[500]=b[500]=500; if (ans[i]=='0') b[i]=500; else a[i]=500; int tp=Query(501,a,b); if (tp==500){ if (ans[i]=='0') ans+='1'; else ans+='0'; } else ans+=ans[i]; } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...