Submission #588794

#TimeUsernameProblemLanguageResultExecution timeMemory
588794radalArt Collections (BOI22_art)C++17
100 / 100
2091 ms576 KiB
#include <bits/stdc++.h> #include "art.h" //#pragma GCC target("sse,sse2,sse4,avx2") //#pragma GCC optimize("unroll-loops,O2") #define rep(i,l,r) for (int i = l; i < r; i++) #define repr(i,r,l) for (int i = r; i >= l; i--) #define X first #define Y second #define all(x) (x).begin() , (x).end() #define pb push_back #define endl '\n' #define debug(x) cerr << #x << " : " << x << endl; using namespace std; typedef long long ll; typedef long double ld; typedef pair<int,int> pll; constexpr int N = 1e5+10,mod = 1e9+7,inf = 1e9+10; inline int mkay(int a,int b){ if (a+b >= mod) return a+b-mod; if (a+b < 0) return a+b+mod; return a+b; } inline int poww(int a,int k){ if (k < 0) return 0; int z = 1; while (k){ if (k&1) z = 1ll*z*a%mod; a = 1ll*a*a%mod; k >>= 1; } return z; } int ind[N]; void solve(int n){ vector<int> ans,tmp; rep(i,1,n+1) tmp.pb(i); int t1 = publish(tmp); rep(i,1,n){ tmp.clear(); tmp.pb(i+1); rep(j,1,i+1) tmp.pb(j); rep(j,i+2,n+1) tmp.pb(j); int t2 = publish(tmp); ind[i] = i-(t1-t2+i)/2; } ans.pb(1); rep(i,1,n){ ans.insert(ans.begin()+ind[i],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...