Submission #644542

#TimeUsernameProblemLanguageResultExecution timeMemory
644542Tudy006Art Collections (BOI22_art)C++17
0 / 100
0 ms208 KiB
#include <bits/stdc++.h> #include "art.h" using namespace std; vector <int> p; vector <int> ans; //int publish( vector <int> p ) { // int x; // for ( auto it : p ) cout << it << ' '; // cout << endl; // cin >> x; // return x; // //} //void answer( vector <int> p ) { // cout << "The answer is: "; // for ( auto it : p ) cout << it << ' '; //} void solve( int n ) { for ( int i = 1; i <= n; i ++ ) p.push_back( i ); int x = publish( p ), a = x, b; for ( int i = 2; i <= n; i ++ ) { int aux = p[0]; for ( int i = 0; i + 1 < n; i ++ ) p[i] = p[i + 1]; p[n - 1] = aux; b = publish( p ); ans.push_back( ( n - 1 + a - b ) / 2 + 1 ); a = b; } ans.push_back( ( n - 1 + x - a ) / 2 + 1 ); answer( ans ); }

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