제출 #1225756

#제출 시각아이디문제언어결과실행 시간메모리
1225756dostsKoala Game (APIO17_koala)C++20
11 / 100
16 ms432 KiB
#include "koala.h" #include <bits/stdc++.h> #pragma GCC optimize("O3,unroll-loops") #pragma GCC target("avx2") //#define int long long #define pii pair<int,int> #define vi vector<int> #define ff first #define ss second #define sp << " " << #define all(x) x.begin(),x.end() #define big(x) ((int)(x.size())) using namespace std; const int MOD = 1e9+7, LIM = 1e6+1, inf = 2e9; int minValue(int N, int W) { int B[N]{},R[N]{}; B[0] = 1; set<int> waste; playRound(B,R); for (int i=0;i<N;i++) if (!R[i]) waste.insert(i); B[0] = 0; B[1] = 1; playRound(B,R); for (int i=0;i<N;i++) if (!R[i] && waste.count(i)) return i; return -1; } int maxValue(int N, int W) { set<int> cand; for (int i = 0;i<N;i++) cand.insert(i); int cur = 1; int B[N]{},R[N]{}; while (big(cand) > 1) { for (int j = 0;j<N;j++) B[j] = 0; for (auto it : cand) B[it] = cur; ++cur; playRound(B,R); for (int j = 0;j<N;j++) if (R[j] <= cur-1) cand.erase(j); } return *cand.begin(); } int greaterValue(int N, int W) { // TODO: Implement Subtask 3 solution here. // You may leave this function unmodified if you are not attempting this // subtask. 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. } }
#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...