제출 #860584

#제출 시각아이디문제언어결과실행 시간메모리
860584E869120Art Collections (BOI22_art)C++17
100 / 100
1268 ms1804 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; } } // Step 3 vector<int> FinalAns(N, 0); for (int i = 0; i < N; i++) FinalAns[Answer[i] - 1] = i + 1; answer(FinalAns); }

컴파일 시 표준 에러 (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...