Submission #714276

#TimeUsernameProblemLanguageResultExecution timeMemory
714276vjudge1Art Collections (BOI22_art)C++17
20 / 100
106 ms208 KiB
#include "art.h" #include <bits/stdc++.h> #define pb push_back using namespace std; typedef long long ll; void solve(int N){ ll b[N+1]; for(int i=1;i<=N;i++){ b[i]=0; } vector<int> a; for(int i=1;i<=N;i++){ for(int j=i+1;j<=N;j++){ a.pb(i); a.pb(j); for(int z=1;z<=N;z++){ if(z!=i && z!=j){ a.pb(z); } } ll res1=publish(a); swap(a[0],a[1]); ll res2=publish(a); if(res1<res2){ b[a[0]]++; } else{ b[a[1]]++; } a.clear(); } } a.resize(N); for(int i=1;i<=N;i++){ a[b[i]]=i; } answer(a); }

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