Submission #1084550

#TimeUsernameProblemLanguageResultExecution timeMemory
1084550PagodePaivaAncient Machine 2 (JOI23_ancient2)C++17
10 / 100
89 ms1240 KiB
#include "ancient2.h"
#include<bits/stdc++.h>

using namespace std;

namespace {

int variable_example = 1;

}  // namespace

std::string Solve(int N) {
  // int m = 2;
  // std::vector<int> a(m), b(m);
  //variable_example = Query(m, a, b);
  string s;
  for(int i = 0;i < N;i++){
    int m = i+3;
    vector <int> a, b;
    for(int j = 0;j < m-3;j++){
      a.push_back(j+1);
      b.push_back(j+1);
    }
    a.push_back(i+1);
    b.push_back(i+2);
    a.push_back(i+1);
    a.push_back(i+2);
    b.push_back(i+1);
    b.push_back(i+2);
    int v = Query(m,a, b);
    if(v == i+1) s.push_back('0');
    else s.push_back('1');
  }
  return s;

}

Compilation message (stderr)

ancient2.cpp:8:5: warning: '{anonymous}::variable_example' defined but not used [-Wunused-variable]
    8 | int variable_example = 1;
      |     ^~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...