제출 #632567

#제출 시각아이디문제언어결과실행 시간메모리
632567mansurKoala Game (APIO17_koala)C++17
19 / 100
18 ms316 KiB
#include "koala.h"
#include<bits/stdc++.h>

using namespace std;

#define all(a) a.begin(), a.end()                                                   
#define rall(a) a.rbegin(), a.rend()                 
#define sz(a) a.size()
#define pb push_back
#define vt vector
#define s second
#define f first
#define nl '\n'
 
using ll = long long;
using pii = pair<int, int>;
 
vt<pii> dir = {{1, 0}, {-1, 0}, {0, 1}, {0, -1}};
 
const int N = 1e5 + 5, mod = 1e9 + 7;

const int inf = 2e9;
 
double eps = 1e-6;

int minValue(int n, int w) {
	int a[n], b[n];
	a[0] = 1;
	for (int i = 1; i < n; i++) a[i] = 0;
	playRound(a, b);
	for (int i = 0; i < n; i++) {
		if (!b[i]) return i;
	}
    return 0;
}

int maxValue(int n, int w) {
	vt<int> p;
	for (int i = 0; i < n; i++) p.pb(i);
	while (sz(p) > 1) {
		int a[n], b[n];
		for (int i = 0; i < n; i++) a[i] = 0;
		int m = sz(p);
		int v = n / m;
		for (int i: p) a[i] = v;
		playRound(a, b);
		vt<int> h;
		for (int i: p) {
			if (b[i] == v + 1) h.pb(i); 
		}
		swap(p, h);
	}
	return p[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...