Submission #860582

#TimeUsernameProblemLanguageResultExecution timeMemory
860582E869120Art Collections (BOI22_art)C++17
0 / 100
1 ms344 KiB
#include "art.h" #include <iostream> using namespace std; int Return[100009]; void solve(int N) { // Step 1 for (int i = 1; i <= N; i++) { vector<int> Order; Order.push_back(i); for (int j = 1; j <= N; j++) { if (j != i) Order.push_back(j); } Return[i] = publish(Order); } // Step 2 vector<int> Answer = {1}; for (int i = 2; i <= N; i++) { int diff = Return[i] - Return[1]; int val = (diff + (i - 1)) / 2 + 1; Answer.push_back(val); for (int j = 0; j < i - 1; j++) { if (Answer[j] >= val) Answer[j] += 1; } } answer(Answer); }

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