제출 #1072378

#제출 시각아이디문제언어결과실행 시간메모리
1072378Joshua_Andersson커다란 상품 (IOI17_prize)C++14
20 / 100
67 ms2132 KiB
#include "prize.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; const ll linf = ll(1e18); typedef vector<int> vi; typedef vector<vi> vvi; typedef pair<int, int> p2; #define rep(i, high) for (int i = 0; i < high; i++) #define repp(i, low, high) for (int i = low; i < high; i++) #define repe(i, container) for (auto& i : container) #define sz(container) ((int)container.size()) #define all(x) begin(x),end(x) #if _LOCAL #define assert(x) if (!(x)) __debugbreak() #endif int find_best(int n) { int a = 4000; int b = 4000; vector<p2> density(n); rep(i, n) density[i].second = i; uniform_int_distribution<int> dist(1, n - 2); mt19937 rng(10); rep(i, a) { int p = dist(rng); vi res = ask(p); //rep(i, p) density[i].first += res[0]; //repp(i, p+1,n) density[i].first += res[1]; density[0].first += res[0]; density[p].first -= res[0]; density[p + 1].first += res[1]; } repp(i, 1, n) density[i].first += density[i - 1].first; sort(density.rbegin(), density.rend()); repe(u, density) { vi res = ask(u.second); if (res[0]==0&&res[1]==0) { return u.second; } } return 0; }

컴파일 시 표준 에러 (stderr) 메시지

prize.cpp: In function 'int find_best(int)':
prize.cpp:25:6: warning: unused variable 'b' [-Wunused-variable]
   25 |  int b = 4000;
      |      ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...