Submission #598063

#TimeUsernameProblemLanguageResultExecution timeMemory
598063jhnah917Art Collections (BOI22_art)C++17
70 / 100
1547 ms656 KiB
#ifndef LOCAL #include "art.h" #endif #include <bits/stdc++.h> using namespace std; void solve(int n){ vector<int> cost(n+1); for(int i=1; i<=n; i++){ vector<int> now; for(int j=1; j<=n; j++) if(i != j) now.push_back(j); now.insert(now.begin(), i); int t1 = publish(now); now.erase(now.begin()); now.push_back(i); int t2 = publish(now); now.pop_back(); cost[i] = t1 - t2; } vector<int> res(n); iota(res.begin(), res.end(), 1); sort(res.begin(), res.end(), [&](int a, int b){ return cost[a] < cost[b]; }); answer(res); }

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