Submission #582470

#TimeUsernameProblemLanguageResultExecution timeMemory
582470tutisArt Collections (BOI22_art)C++17
0 / 100
1 ms208 KiB
#include <bits/stdc++.h> #include "art.h" using namespace std; mt19937_64 rng(0); void solve(int N) { int ans[N]; vector<int>P(N); for (int t = 0; t < N; t++) { for (int i = 0; i < N; i++) P[i] = (i + t) % N + 1; ans[t] = publish(P); } for (int i = 0; i < N; i++) { int del = ans[i] - ans[(i + 1) % N]; //x k y //k xy x //xy k y //del = y - x //n-1 = x + y //n-1-del = x+y+x-y =2x int x = (N - 1 - del) / 2; P[x] = i + 1; } answer(P); }

Compilation message (stderr)

interface.cpp: In function 'int publish(std::vector<int>)':
interface.cpp:20:17: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   20 |     if(v.size() != N) {
      |        ~~~~~~~~~^~~~
interface.cpp: In function 'void answer(std::vector<int>)':
interface.cpp:36:17: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   36 |     if(v.size() != N) {
      |        ~~~~~~~~~^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...