제출 #555038

#제출 시각아이디문제언어결과실행 시간메모리
555038hhhhaura코알라 (APIO17_koala)C++14
37 / 100
67 ms456 KiB
#define wiwihorz #include "koala.h" #include <bits/stdc++.h> #pragma GCC optimize("Ofast") #pragma GCC target("sse") #pragma loop-opt(on) #define rep(i, a, b) for(int i = a; i <= b; i ++) #define rrep(i, a, b) for(int i = b; i >= a; i --) #define all(x) x.begin(), x.end() #define ceil(a, b) ((a + b - 1) / (b)) #define ll long long int #define lld long double #define pii pair<int, int> #define random mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count()) #define INF 1000000000000000000 #define MOD 1000000007 #define eps (1e-9) using namespace std; #ifdef wiwihorz #define print(a...)cerr<<"Line "<<__LINE__<<":",kout("["+string(#a)+"] = ", a) void vprint(auto L,auto R){while(L<R)cerr<<*L<<" \n"[next(L) == R], ++L; } void kout() { cerr << endl; } template<class T1,class ... T2>void kout(T1 a,T2 ... e){cerr<<a<<" ",kout(e...);} #else #define print(...) 0 #define vprint(...) 0 #endif int B[100], R[100]; const int P = 100; void clean() { rep(i, 0, P - 1) B[i] = 0; rep(i, 0, P - 1) R[i] = 0; } int minValue(int N, int W) { clean(); B[0] = 1; playRound(B, R); rep(i, 0, N - 1) { if(R[i] == 0) return i; } return 0; } int maxValue(int N, int W) { vector<int> v(N, 0); iota(all(v), 0); while(v.size() > 1) { clean(); vprint(all(v)); int x = W / v.size(); for(auto i : v) B[i] = x; playRound(B, R); v.clear(); rep(i, 0, N - 1) if(R[i] > x) v.push_back(i); } return v[0]; } int greaterValue(int N, int W) { int l = 1, r = 9; while(l <= r) { int mid = (l + r) / 2; clean(); B[0] = mid; B[1] = mid; playRound(B, R); bool a = R[0] > mid; bool b = R[1] > mid; if(a && b) l = mid + 1; else if(!a && !b) r = mid - 1; else return a < b; } assert(0); return 0; } void allValues(int N, int W, int *P) { if (W == 2*N) { // TODO: Implement Subtask 4 solution here. // You may leave this block unmodified if you are not attempting this // subtask. } else { // TODO: Implement Subtask 5 solution here. // You may leave this block unmodified if you are not attempting this // subtask. } }

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

koala.cpp:6: warning: ignoring '#pragma loop ' [-Wunknown-pragmas]
    6 | #pragma loop-opt(on)
      | 
koala.cpp:21:13: warning: use of 'auto' in parameter declaration only available with '-fconcepts-ts'
   21 | void vprint(auto L,auto R){while(L<R)cerr<<*L<<" \n"[next(L) == R], ++L; }
      |             ^~~~
koala.cpp:21:20: warning: use of 'auto' in parameter declaration only available with '-fconcepts-ts'
   21 | void vprint(auto L,auto R){while(L<R)cerr<<*L<<" \n"[next(L) == R], ++L; }
      |                    ^~~~
#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...