제출 #1005709

#제출 시각아이디문제언어결과실행 시간메모리
1005709nikdArt Collections (BOI22_art)C++17
100 / 100
935 ms1668 KiB
#include <bits/stdc++.h> using namespace std; int publish(std::vector<int>); void answer(std::vector<int>); void solve(int N) { vector<int> vec(N); for(int i = 0; i<N; i++) vec[i]=i+1; vector<int> sol(N); int inv1 = publish(vec); int last_inv = inv1; for(int i = 0; i<N-1; i++){ int last = vec[0]; for(int j = 0; j<N-1; j++) vec[j]=vec[j+1]; vec[N-1]=last; int inv = publish(vec); sol[i]=(last_inv-inv+N)/2; last_inv = inv; } sol[N-1]=(last_inv-inv1+N)/2; sort(vec.begin(), vec.end(), [sol](int a, int b){ return sol[a-1]<sol[b-1]; }); answer(vec); }

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