제출 #967446

#제출 시각아이디문제언어결과실행 시간메모리
967446penguin133Art Collections (BOI22_art)C++17
100 / 100
1141 ms1852 KiB
#include <bits/stdc++.h> using namespace std; #include "art.h" //#define int long long #define pi pair<int, int> #define pii pair<int, pi> #define fi first #define se second #ifdef _WIN32 #define getchar_unlocked _getchar_nolock #endif mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count()); void solve(int N) { vector <int> x; vector <int> ans(N); for(int i = 1; i <= N; i++)x.push_back(i); vector <int> res; for(int i = 1; i <= N; i++){ res.push_back(publish(x)); x.erase(x.begin()); x.push_back(i); } res.push_back(res[0]); for(int i = 1; i <= N; i++){ int diff = res[i] - res[i - 1]; int br = (diff + N - 1) / 2; assert((diff + N - 1) % 2 == 0); int tot = br - diff; ans[tot] = i; } answer(ans); }

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