Submission #1267146

#TimeUsernameProblemLanguageResultExecution timeMemory
1267146YassirSalamaKoala Game (APIO17_koala)C++20
19 / 100
8 ms432 KiB
#include "koala.h" #include<bits/stdc++.h> using namespace std; #define all(v) v.begin(),v.end() #define pb push_back #ifdef IOI template<typename A, typename B> ostream& operator<<(ostream &os, const pair<A, B> &p) { return os << '(' << p.first << ", " << p.second << ')'; } template<typename T_container, typename T = typename enable_if<!is_same<T_container, string>::value, typename T_container::value_type>::type> ostream& operator<<(ostream &os, const T_container &v) { os << '{'; string sep; for (const T &x : v) os << sep << x, sep = ", "; return os << '}'; } void dbg_out() { cout << endl; } template<typename Head, typename... Tail> void dbg_out(Head H, Tail... T) { cout << ' ' << H; dbg_out(T...); } #define dbg(...) cout << "(" << #__VA_ARGS__ << "):", dbg_out(__VA_ARGS__); #else #define dbg(...) 1337; #endif int minValue(int N, int W) { int n = N; int w = W; int b[n]; memset(b,0,sizeof(b)); b[0] = 1; int r[n]; playRound(b,r); for(int i = 0;i<n;i++){ if(!r[i]){ return i; } } return 0; } int maxValue(int N, int W) { int n = N; int w = W; vector<int> ind; for(int i = 0;i<n;i++){ ind.pb(i); } vector<int> us; while(true){ if(ind.size() == 1){ return ind[0]; } int b[n]; memset(b,0,sizeof(b)); int k = w/ind.size(); for(auto x : ind){ b[x] = k; } vector<int> a; int r[n]; playRound(b,r); for(auto x : ind){ if(r[x]>b[x]){ a.pb(x); } } swap(ind,a); } return 0; } int greaterValue(int N, int W) { return 0; } void allValues(int N, int W, int *P) { if (W == 2*N) { } else { } }
#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...