Submission #573553

#TimeUsernameProblemLanguageResultExecution timeMemory
573553NintsiChkhaidzeArt Collections (BOI22_art)C++17
100 / 100
1688 ms628 KiB
#include "art.h" #include <bits/stdc++.h> #define pb push_back using namespace std; int st[4005],en[4005]; void solve(int N) { vector <int> order,v; v.clear(); for (int i=1;i<=N;i++) order.pb(i),v.pb(i); for (int i = 1; i <= N; i++){ int r = publish(v); st[v[0]] = r,en[v.back()] = r; v.pb(v[0]); v.erase(v.begin()); } for (int i = 1; i <= N; i++){ int id = (N + 1 + st[i] - en[i])/2; order[id-1] = i; } answer(order); }

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...