답안 #115898

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
115898 2019-06-09T13:03:44 Z aminra Broken Device (JOI17_broken_device) C++14
0 / 100
77 ms 3128 KB
#include <bits/stdc++.h>
#include "Annalib.h"
using namespace std;
typedef long long ll;
typedef long double ld;
const int MOD = (int)1e9 + 7;
const int MAXN = (int)153;
const int infint = (int)1e9 + 3;
const ll inf = (ll)1e18;
void Anna(int N, ll X, int K, int P[])
{
	vector<int> bad(N, 0), ans(N, 0);
	for (int i = 0; i < K; i++)
		bad[P[i]] = 1;
	
	for (int i = 0; i < N; i += 3)
	{
		if(bad[i] + bad[i + 1] + bad[i + 2] > 1)
			continue;
		if(bad[i] + bad[i + 1] + bad[i + 2] == 0)
		{
			if(X % 4 == 0)
				ans[i] = 1;
			else
			if(X % 4 == 1)
				ans[i + 1] = ans[i + 2] = 1;
			else
			if(X % 4 == 2)
				ans[i] = ans[i + 2] = 1;
			else
			if(X % 4 == 3)
				ans[i] = ans[i + 1] = ans[i + 2] = 1;
			X /= 4;
			continue;
		}
		else
		if(bad[i + 1] == 0)
		{
			if(X % 2 == 0)
				ans[i + 1] = 1;
			else
			if(bad[i + 2] == 0)
				ans[i + 2] = 1;
			else
				ans[i] = ans[i + 1] = 1;
			X /= 2;
			continue;
		}
		else
		{
			if(X % 2 == 0)
				ans[i + 2] = 1, X /= 2;
			else
			if(X % 4 == 0)
				ans[i] = 1, X /= 4;
			else
				ans[i] = ans[i + 2] = 1, X /= 4;
		}
	}
	for (int i = 0; i < N; i++)
		Set(i, ans[i]);
}
/*int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0); cout.tie(0);
}*/
#include <bits/stdc++.h>
#include "Annalib.h"
using namespace std;
typedef long long ll;
typedef long double ld;
const int MOD = (int)1e9 + 7;
const int MAXN = (int)153;
const int infint = (int)1e9 + 3;
const ll inf = (ll)1e18;
ll Bruno(int N, int A[])
{
	ll ans = 0;
	for (int i = N - 3; i >= 0; i -= 3)
		if(A[i] == 0 && A[i + 1] == 0 && A[i + 2] == 0)
			continue;
		else
		if(A[i] == 1 && A[i + 1] == 0 && A[i + 2] == 0)
			ans = 1LL * ans * 4;
		else
		if(A[i] == 0 && A[i + 1] == 1 && A[i + 2] == 1)
			ans = 1LL * ans * 4 + 1;
		else
		if(A[i] == 1 && A[i + 1] == 0 && A[i + 2] == 1)
			ans = 1LL * ans * 4 + 2;
		else
		if(A[i] == 1 && A[i + 1] == 1 && A[i + 2] == 1)
			ans = 1LL * ans * 4 + 3;
		else
		if(A[i] == 0 && A[i + 1] == 0 && A[i + 2] == 1)
			ans = 1LL * ans * 2 + 1;
		else
		if(A[i] == 0 && A[i + 1] == 1 && A[i + 2] == 0)
			ans = 1LL * ans * 2;
		else
			ans = 1LL * ans * 2 + 1;
	return ans;
}
/*int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0); cout.tie(0);
}*/
# 결과 실행 시간 메모리 Grader output
1 Incorrect 35 ms 3056 KB Output isn't correct - L* = 0
2 Incorrect 34 ms 3056 KB Output isn't correct - L* = 0
3 Incorrect 34 ms 3072 KB Output isn't correct - L* = 0
4 Incorrect 35 ms 3056 KB Output isn't correct - L* = 0
5 Incorrect 35 ms 3072 KB Output isn't correct - L* = 0
6 Incorrect 33 ms 3072 KB Output isn't correct - L* = 0
7 Incorrect 33 ms 3072 KB Output isn't correct - L* = 0
8 Incorrect 35 ms 3072 KB Output isn't correct - L* = 0
9 Incorrect 33 ms 3056 KB Output isn't correct - L* = 0
10 Incorrect 35 ms 3072 KB Output isn't correct - L* = 0
11 Incorrect 35 ms 3072 KB Output isn't correct - L* = 0
12 Incorrect 34 ms 3072 KB Output isn't correct - L* = 0
13 Incorrect 33 ms 3072 KB Output isn't correct - L* = 0
14 Incorrect 35 ms 3072 KB Output isn't correct - L* = 0
15 Incorrect 35 ms 3072 KB Output isn't correct - L* = 0
16 Incorrect 35 ms 3072 KB Output isn't correct - L* = 0
17 Incorrect 36 ms 3056 KB Output isn't correct - L* = 0
18 Incorrect 36 ms 3072 KB Output isn't correct - L* = 0
19 Incorrect 35 ms 3072 KB Output isn't correct - L* = 0
20 Incorrect 34 ms 3016 KB Output isn't correct - L* = 0
21 Incorrect 34 ms 3072 KB Output isn't correct - L* = 0
22 Incorrect 35 ms 3072 KB Output isn't correct - L* = 0
23 Incorrect 33 ms 3072 KB Output isn't correct - L* = 0
24 Incorrect 36 ms 3072 KB Output isn't correct - L* = 0
25 Incorrect 37 ms 2840 KB Output isn't correct - L* = 0
26 Incorrect 35 ms 3072 KB Output isn't correct - L* = 0
27 Incorrect 34 ms 2968 KB Output isn't correct - L* = 0
28 Incorrect 35 ms 3128 KB Output isn't correct - L* = 0
29 Incorrect 34 ms 3072 KB Output isn't correct - L* = 0
30 Incorrect 77 ms 3072 KB Output isn't correct - L* = 0
31 Incorrect 35 ms 3072 KB Output isn't correct - L* = 0
32 Incorrect 34 ms 2864 KB Output isn't correct - L* = 0
33 Incorrect 35 ms 3064 KB Output isn't correct - L* = 0
34 Incorrect 35 ms 3072 KB Output isn't correct - L* = 0
35 Incorrect 35 ms 3072 KB Output isn't correct - L* = 0
36 Incorrect 42 ms 3072 KB Output isn't correct - L* = 0
37 Incorrect 35 ms 3008 KB Output isn't correct - L* = 0
38 Incorrect 36 ms 3072 KB Output isn't correct - L* = 0
39 Incorrect 35 ms 3072 KB Output isn't correct - L* = 0
40 Incorrect 36 ms 3008 KB Output isn't correct - L* = 0