답안 #231257

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
231257 2020-05-13T08:47:13 Z bensonlzl Broken Device (JOI17_broken_device) C++14
0 / 100
13 ms 1280 KB
#include <bits/stdc++.h>
#include "Annalib.h"

using namespace std;

typedef long long ll;

int usable[155], ans[155];

void Anna(int N, long long X, int K, int P[]){
	mt19937 rng(8537295);
	vector<int> v;
	for (int i = 0; i < N; ++i){
		usable[i] = 1;
		ans[i] = 0;
		v.push_back(i);
	}
	shuffle(v.begin(),v.end(),rng);
	for (int i = 0; i < K; ++i){
		usable[P[i]] = 0;
	}
	for (int i = 0; i < N; i += 2){
		if (usable[v[i]] && usable[v[i+1]]){
			if (X%3 == 0){
				ans[v[i]] = 0;
				ans[v[i+1]] = 1;
			}
			else if (X%3 == 0){
				ans[v[i]] = 1;
				ans[v[i+1]] = 0;
			}
			else{
				ans[v[i]] = 1;
				ans[v[i+1]] = 1;
			} 
			X /= 3;
		}
		else{
			ans[v[i]] = ans[v[i+1]] = 0;
		}
	}
	if (X != 0) assert(0);
	for (int i = 0; i < N; ++i){
		Set(i,ans[i]);
	}
}
#include <bits/stdc++.h>
#include "Annalib.h"

using namespace std;

typedef long long ll;

long long Bruno(int N, int A[]){
	mt19937 rng(8537295); 
	ll ans = 0;
	vector<int> v;
	for (int i = 0; i < N; ++i){
		v.push_back(i);
	}
	shuffle(v.begin(),v.end(),rng);
	ll coeff = 1;
	for (int i = 0; i < N; i += 2){
		if (A[v[i]] || A[v[i+1]]){
			if (A[v[i]] && !A[v[i+1]]){
				ans += 1*coeff;
			}
			else if (A[v[i]] && A[v[i+1]]){
				ans += 2*coeff;
			}
			coeff *= 3;
			if (coeff > 1e18) break;
		}
	}
	return ans;
}
# 결과 실행 시간 메모리 Grader output
1 Runtime error 5 ms 512 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Runtime error 10 ms 1024 KB Execution killed with signal 11 (could be triggered by violating memory limits)
3 Runtime error 6 ms 640 KB Execution killed with signal 11 (could be triggered by violating memory limits)
4 Runtime error 13 ms 1280 KB Execution killed with signal 11 (could be triggered by violating memory limits)
5 Runtime error 6 ms 640 KB Execution killed with signal 11 (could be triggered by violating memory limits)
6 Runtime error 6 ms 640 KB Execution killed with signal 11 (could be triggered by violating memory limits)
7 Runtime error 6 ms 640 KB Execution killed with signal 11 (could be triggered by violating memory limits)
8 Runtime error 7 ms 640 KB Execution killed with signal 11 (could be triggered by violating memory limits)
9 Runtime error 5 ms 512 KB Execution killed with signal 11 (could be triggered by violating memory limits)
10 Runtime error 5 ms 512 KB Execution killed with signal 11 (could be triggered by violating memory limits)
11 Runtime error 8 ms 768 KB Execution killed with signal 11 (could be triggered by violating memory limits)
12 Runtime error 6 ms 640 KB Execution killed with signal 11 (could be triggered by violating memory limits)
13 Runtime error 11 ms 896 KB Execution killed with signal 11 (could be triggered by violating memory limits)
14 Runtime error 6 ms 640 KB Execution killed with signal 11 (could be triggered by violating memory limits)
15 Runtime error 6 ms 512 KB Execution killed with signal 11 (could be triggered by violating memory limits)
16 Runtime error 7 ms 640 KB Execution killed with signal 11 (could be triggered by violating memory limits)
17 Runtime error 5 ms 512 KB Execution killed with signal 11 (could be triggered by violating memory limits)
18 Runtime error 7 ms 768 KB Execution killed with signal 11 (could be triggered by violating memory limits)
19 Runtime error 9 ms 896 KB Execution killed with signal 11 (could be triggered by violating memory limits)
20 Runtime error 9 ms 896 KB Execution killed with signal 11 (could be triggered by violating memory limits)
21 Runtime error 5 ms 512 KB Execution killed with signal 11 (could be triggered by violating memory limits)
22 Runtime error 9 ms 896 KB Execution killed with signal 11 (could be triggered by violating memory limits)
23 Runtime error 5 ms 512 KB Execution killed with signal 11 (could be triggered by violating memory limits)
24 Runtime error 6 ms 512 KB Execution killed with signal 11 (could be triggered by violating memory limits)
25 Runtime error 10 ms 896 KB Execution killed with signal 11 (could be triggered by violating memory limits)
26 Runtime error 7 ms 768 KB Execution killed with signal 11 (could be triggered by violating memory limits)
27 Runtime error 7 ms 768 KB Execution killed with signal 11 (could be triggered by violating memory limits)
28 Runtime error 6 ms 640 KB Execution killed with signal 11 (could be triggered by violating memory limits)
29 Runtime error 5 ms 512 KB Execution killed with signal 11 (could be triggered by violating memory limits)
30 Runtime error 6 ms 640 KB Execution killed with signal 11 (could be triggered by violating memory limits)
31 Runtime error 6 ms 512 KB Execution killed with signal 11 (could be triggered by violating memory limits)
32 Runtime error 6 ms 640 KB Execution killed with signal 11 (could be triggered by violating memory limits)
33 Runtime error 10 ms 896 KB Execution killed with signal 11 (could be triggered by violating memory limits)
34 Runtime error 6 ms 512 KB Execution killed with signal 11 (could be triggered by violating memory limits)
35 Runtime error 6 ms 512 KB Execution killed with signal 11 (could be triggered by violating memory limits)
36 Runtime error 7 ms 768 KB Execution killed with signal 11 (could be triggered by violating memory limits)
37 Runtime error 6 ms 640 KB Execution killed with signal 11 (could be triggered by violating memory limits)
38 Runtime error 5 ms 512 KB Execution killed with signal 11 (could be triggered by violating memory limits)
39 Runtime error 6 ms 640 KB Execution killed with signal 11 (could be triggered by violating memory limits)
40 Runtime error 6 ms 640 KB Execution killed with signal 11 (could be triggered by violating memory limits)