제출 #644545

#제출 시각아이디문제언어결과실행 시간메모리
644545Tudy006Art Collections (BOI22_art)C++17
100 / 100
1558 ms672 KiB
#include <bits/stdc++.h> #include "art.h" using namespace std; // //int a[1000]; //int v[1000]; // //int n; // //int publish( vector <int> p ) { // int x = 0; // for ( auto it : p ) cout << it << ' '; // for ( int i = 0; i < n; i ++ ) v[i] = a[p[i] - 1]; // for ( int i = 0; i < n; i ++ ) // for ( int j = i + 1; j < n; j ++ ) // x += ( v[i] > v[j] ); // cout << ": " << x << endl; // return x; //} //void answer( vector <int> p ) { // cout << "The answer is: "; // for ( auto it : p ) cout << it << ' '; //} void solve( int n ) { vector <int> query; for ( int i = 0; i < n; i ++ ) { vector <int> p(n); for ( int j = 0; j < n; j ++ ) { p[j] = ( i + j ) % n + 1; } query.push_back( publish( p ) ); } vector <int> ans(n); for ( int i = 0; i < n; i ++ ) { ans[( n - 1 + query[i] - query[( i + 1 ) % n] ) / 2] = i + 1; } answer( ans ); } // //int main() { // cin >> n; // for ( int i = 0; i < n; i ++ ) cin >> a[i]; // solve( n ); // return 0; //}

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