Submission #602444

#TimeUsernameProblemLanguageResultExecution timeMemory
602444almothana05Art Collections (BOI22_art)C++17
100 / 100
1641 ms752 KiB
#include "art.h" #include "bits/stdc++.h" using namespace std; vector<int>num, jet , bev; void solve(int menge) { int numm , cmp , er ,zw; bev.push_back(menge); for(int i = menge ; i > 0 ; i--){ num.push_back(i); } int comp = publish(num); num.clear(); for(int k = menge - 1 ; k > 0 ; k--){ num.clear(); num.push_back(k); for(int i = menge ; i > 0 ; i--){ if(i != k){ num.push_back(i); } } cmp = publish(num) - comp; numm = menge - k; er = (numm + cmp) / 2; zw = er - cmp; for(int i = 0 ; i < zw ; i++){ jet.push_back(bev[i]); } jet.push_back(k); for(int i = zw ; i < bev.size() ; i++){ jet.push_back(bev[i]); } bev = jet; jet.clear(); } reverse(bev.begin() , bev.end()); answer(bev); }

Compilation message (stderr)

art.cpp: In function 'void solve(int)':
art.cpp:29:28: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   29 |         for(int i = zw ; i < bev.size() ; i++){
      |                          ~~^~~~~~~~~~~~
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...