Submission #1260147

#TimeUsernameProblemLanguageResultExecution timeMemory
1260147Seyyed_Mojtaba_MortazaviKoala Game (APIO17_koala)C++20
19 / 100
8 ms432 KiB
#include "koala.h" #include <bits/stdc++.h> using namespace std; const int MAXN = 5e5 + 10; int minValue(int n, int w) { int b[n]; int r[n]; memset(b, 0, sizeof(b)); b[0] = 1; playRound(b, r); for (int i = 0; i < n; i++) { if (b[i] >= r[i]) return i; } } int maxValue(int n, int w) { int b[n]; int r[n]; vector <int> mx; for (int i = 0; i < n; i++) mx.push_back(i); while (mx.size() > 1) { memset(b, 0, sizeof(b)); int tmp = w / mx.size(); for (auto i : mx) b[i] = tmp; playRound(b, r); mx.clear(); for (int i = 0; i < n; i++) { if (r[i] > tmp) mx.push_back(i); } } return mx[0]; } int greaterValue(int n, int w) { return 0; } void allValues(int n, int w, int *p) { }

Compilation message (stderr)

koala.cpp: In function 'int minValue(int, int)':
koala.cpp:20:1: warning: control reaches end of non-void function [-Wreturn-type]
   20 | }
      | ^
#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...