제출 #1282864

#제출 시각아이디문제언어결과실행 시간메모리
1282864dosts코알라 (APIO17_koala)C++20
4 / 100
4 ms332 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; for (int j = 1;j<N;j++) B[j] = 0; playRound(B,R); for (int j = 1;j<N;j++) { if (!R[j]) return j; } B[1] = 1; B[0] = 0; playRound(B,R); if (!R[0]) return 0; for (int j = 1;j<N;j++) { if (!R[j]) return j; } return -1; } int maxValue(int N, int W) { assert(N == W && W == 100); int B[N]{},R[N]{}; for (int i = 0;i<N;i++) B[i] = 1; vi top50; playRound(B,R); for (int i = 0;i<N;i++) if (R[i] == 2) top50.push_back(i); for (int i = 0;i<N;i++) B[i] = 0; for (auto it : top50) B[it] = 2; assert(big(top50) == 50); playRound(B,R); vi top25; for (int i = 0;i<N;i++) if (R[i] == 3) top25.push_back(i); assert(big(top25) == 25); for (int i = 0;i<N;i++) B[i] = 0; for (auto it : top25) B[it] = 3; playRound(B,R); vi top6; for (int i = 0;i<N;i++) if (R[i] == 4) top6.push_back(i); for (int i = 0;i<N;i++) B[i] = 0; for (auto it : top6) B[it] = 12; playRound(B,R); vi top1; for (int i = 0;i<N;i++) if (R[i] == 13) top1.push_back(i); return top1[0]; } int greaterValue(int N, int W) { } void allValues(int N, int W, int *P) { }

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

koala.cpp: In function 'int greaterValue(int, int)':
koala.cpp:64:1: warning: no return statement in function returning non-void [-Wreturn-type]
   64 | }
      | ^
#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...