Submission #720161

#TimeUsernameProblemLanguageResultExecution timeMemory
720161gagik_2007Art Collections (BOI22_art)C++17
70 / 100
1518 ms880 KiB
#include "art.h" #include <iostream> #include <algorithm> #include <string> #include <vector> #include <cmath> #include <chrono> #include <ctime> #include <set> #include <map> #include <stack> #include <queue> #include <deque> #include <limits> #include <iomanip> #include <unordered_set> #include <unordered_map> #include <fstream> #include <functional> #include <random> #include <cassert> using namespace std; typedef long long ll; typedef long double ld; #define ff first #define ss second ll ttt; const ll INF = 1e18; const ll MOD = 1e9 + 7; const ll N = 1000007; ll n, m, k; void solve(int NN) { n = NN; vector<int>p; for (int i = 1; i <= n; i++) { p.push_back(i); } vector<int>ans(n, -1); int lst = publish(p); int cur = n; for (int i = 0; i < n; i++) { p.insert(p.begin(), p.back()); p.pop_back(); int vl = publish(p); int x = lst - vl; ans[(x + n - 1) / 2] = cur; cur--; lst = vl; } reverse(ans.begin(), ans.end()); 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...