Submission #574210

#TimeUsernameProblemLanguageResultExecution timeMemory
574210JasiekstrzArt Collections (BOI22_art)C++17
100 / 100
1564 ms800 KiB
#include<bits/stdc++.h> #include "art.h" #define fi first #define se second using namespace std; vector<int> t; vector<int> r; vector<pair<int,int>> srt; void solve(int N) { for(int i=1;i<=N;i++) t.push_back(i); for(int i=1;i<=N;i++) { r.push_back(publish(t)); t.erase(t.begin()); t.push_back(i); } r.push_back(r[0]); for(int i=1;i<=N;i++) { int w=r[i-1]-r[i]; w=(w+N+1)/2; srt.emplace_back(w,i); } sort(srt.begin(),srt.end()); t.clear(); for(auto [a,b]:srt) t.push_back(b); answer(t); return; }

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