Submission #646008

#TimeUsernameProblemLanguageResultExecution timeMemory
646008GaLzArt Collections (BOI22_art)C++17
100 / 100
1611 ms612 KiB
#include <bits/stdc++.h> #include "art.h" using namespace std; typedef long long ll; typedef pair<ll, ll> pll; typedef pair<int, int> pii; typedef vector<int> vi; typedef vector<ll> vll; const ll mod=1e9+7; const ll maxn=2e5+5; const int INF=1e8; #define ok ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); #define fi first #define se second #define pb push_back #define ub upper_bound #define lb lower_bound #define endl '\n' int ls, cur; void solve(int n) { vi arr(n), ans(n); for(int i=0; i<n; i++) arr[i]=i+1; ls=publish(arr); for(int i=n; i>1; i--) { for(int j=0; j<n; j++) { arr[j]+=n-2; arr[j]%=n; arr[j]++; } cur=publish(arr); ans[(cur-ls+n+1)/2-1]=i; ls=cur; } for(int i=0; i<n; i++) { if(!ans[i]) ans[i]=1; } answer(ans); }

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