Submission #598064

#TimeUsernameProblemLanguageResultExecution timeMemory
598064jhnah917Art Collections (BOI22_art)C++17
100 / 100
1468 ms712 KiB
#ifndef LOCAL #include "art.h" #endif #include <bits/stdc++.h> using namespace std; void solve(int n){ vector<int> cost(n+1); vector<int> v(n); iota(v.begin(), v.end(), 1); for(int i=1; i<=n; i++){ cost[i] = publish(v); rotate(v.begin(), v.begin()+1, v.end()); } vector<int> res(n); iota(res.begin(), res.end(), 1); sort(res.begin(), res.end(), [&](int a, int b){ return cost[a] - cost[a%n+1] < cost[b] - cost[b%n+1]; }); 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...