Submission #503940

#TimeUsernameProblemLanguageResultExecution timeMemory
503940Abrar_Al_SamitXylophone (JOI18_xylophone)C++17
0 / 100
0 ms200 KiB
#include "xylophone.h"
#include <bits/stdc++.h>
using namespace std;




void solve(int N) {
  int p = 2;
  while(query(p, N)==N-1) {
    ++p;
  }
  --p;
  int ans[N+1];
  for(int i=1; i<=N; ++i) {
    if(i==p) {
      ans[i] = 1;
    } else {
      ans[i] = 1+query(1, p);
    }
  }
  for(int i=1; i<=N; ++i) {
    answer(i, ans[i]);
  }
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...