Submission #971276

#TimeUsernameProblemLanguageResultExecution timeMemory
971276groshiArt Collections (BOI22_art)C++17
100 / 100
1660 ms2116 KiB
#include<bits/stdc++.h> #include "art.h" using namespace std; #define int long long int wynik[5000]; vector<int32_t> zmien(list<int32_t> QQ) { vector<int32_t> QQQ; while(QQ.size()) QQQ.push_back(QQ.front()),QQ.pop_front(); return QQQ; } map<int,int> prep; void solve(int32_t n) { for(int i=1;i<=n;i++) prep[-(n-i)+i-1]=i; list<int32_t> Q; for(int i=1;i<=n;i++) Q.push_back(i); int ile=publish(zmien(Q)); for(int i=2;i<=n;i++) { Q.push_front(Q.back()); Q.pop_back(); int nowe=publish(zmien(Q)); int delta=nowe-ile; wynik[prep[delta]]=Q.front(); ile=nowe; } for(int i=1;i<=n;i++) if(wynik[i]==0) wynik[i]=1; vector<int32_t> wypisz; for(int i=1;i<=n;i++) wypisz.push_back(wynik[i]); answer(wypisz); }

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