Submission #701429

#TimeUsernameProblemLanguageResultExecution timeMemory
701429lovrotArt Collections (BOI22_art)C++17
70 / 100
1506 ms540 KiB
#include <cstdio> #include <vector> #include "art.h" #define X first #define Y second #define pb push_back using namespace std; typedef long long ll; typedef pair<int, int> pii; const int N = 4000; int ans[N]; vector<int> v; void solve(int n) { for(int i = 1; i <= n; i++) v.pb(i); int c = publish(v); for(int i = 1; i < n; i++) { int f = v[0]; v.erase(v.begin()); v.pb(f); int c2 = publish(v); int x = (c - c2 + 1 + n) / 2; ans[x] = i; c = c2; } vector<int> sol; for(int i = 1; i <= n; i++) { if(ans[i]) sol.pb(ans[i]); else sol.pb(n); } answer(sol); 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...