Submission #937877

#TimeUsernameProblemLanguageResultExecution timeMemory
937877antonAncient Machine 2 (JOI23_ancient2)C++17
10 / 100
182 ms1580 KiB
#include "ancient2.h"
#include<bits/stdc++.h>

using namespace std;



int mQuery(int m, vector<int>&a, vector<int>&b){
  cout<<m<<endl;
  for(auto e: a){
    cout<<e<<" ";
  }
  cout<<endl;
  for(auto e: b){
    cout<<e<<" ";
  }
  cout<<endl;
  int r= Query(m, a, b);
  cout<<"res "<<r<<endl;
  return r;
}
std::string Solve(int N) {
  
  int n= N;
  string s;
  for(int i = 0; i<n; i++){
    vector<int> a, b;
    for(int j =0; j<i; j++){
      a.push_back(j+1);
      b.push_back(j+1);
    }
    a.push_back(i+2);
    a.push_back(i+1);
    b.push_back(i+1);
    b.push_back(i+2);
    for(int j =i+2; j<n+2; j++){
      a.push_back((j+1)%(n+2));
      b.push_back((j+1)%(n+2));
    }
    int r=  Query(a.size(), a, b);
    if(r==n+1){
      s.push_back('0');
    }
    else{
      s.push_back('1');
    }
    //cout<<s<<endl;
  }
  return s;
}
#Verdict Execution timeMemoryGrader output
Fetching results...