Submission #318776

# Submission time Handle Problem Language Result Execution time Memory
318776 2020-11-03T08:06:44 Z Foxyy Cave (IOI13_cave) C++14
0 / 100
757 ms 512 KB
#include "cave.h"

#include <bits/stdc++.h>
using namespace std;

const int MAXN = 200000;
const int INF = 0x3f3f3f3f, MOD = 1000000007;
#define INIT(arr, val) fill(arr, arr+(int)(sizeof(arr)/sizeof(arr[0])), val)
#define REP(i, lb, rb, inc) for(int i = (lb); i < (rb); i += inc)
#define RREP(i, rb, lb, dec) for(int i = (rb)-1; i >= (lb); i -= dec)
typedef long long ll;
#define sz size()
typedef stack<int, vector<int> > SI;
typedef queue<int> QI;
typedef vector<int> VI;
#define pb push_back
//typedef pair<int, int> PII;
//#define mp make_pair
//#define F first
//#define S second
#define endl '\n'
#define dbg(a, b) cerr << "dbg: a " << b << endl;
#define dbg_itv(a, b, c) cerr << "dbg_itv: " << a << " " << b << " : " << c << endl
#define IOS() cin.tie(0); cout.sync_with_stdio(0)

void exploreCave(int N) {
	int arr[N];
	int D[N], S[N];
    REP(i, 0, N, 1) {
    	fill(arr, arr+N, 0);
    	REP(j, 0, i, 1) arr[D[j]] = S[j];
    	int ret = tryCombination(arr);
   		if (ret > i) S[i] = 0;
		else		 D[i] = 1;
		int lb, rb;
		lb = 0; rb  = N;
		while(rb - lb - 1 > 0) {
			int mid = (lb+rb)/2;
			fill(arr+lb, arr+mid, S[i]); fill(arr+mid, arr+rb, 1-S[i]);
    		REP(j, 0, i, 1) arr[D[j]] = S[j];
			ret = tryCombination(arr);
			if (ret > i) rb = mid;
			else		 lb = mid;
		}
		D[i] = lb;
	}
	answer(S, D);
}
# Verdict Execution time Memory Grader output
1 Incorrect 377 ms 484 KB Answer is wrong
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 757 ms 512 KB Output is correct
2 Incorrect 1 ms 364 KB Answer is wrong
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 364 KB Answer is wrong
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 364 KB Answer is wrong
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 377 ms 484 KB Answer is wrong
2 Halted 0 ms 0 KB -