답안 #923992

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
923992 2024-02-08T08:11:02 Z daoquanglinh2007 Broken Device (JOI17_broken_device) C++17
85 / 100
31 ms 2900 KB
#include "Annalib.h"
#include <bits/stdc++.h>
using namespace std;
 
const int g[] = {45, 39, 34, 16, 24, 55, 54, 63, 19, 44, 41, 70, 61, 29, 57, 12, 72, 53, 42, 69, 48, 15, 11, 28, 66, 50, 17, 62, 58, 74, 35, 9, 68, 30, 45, 21, 47, 23, 5, 67, 41, 12, 14, 6, 17, 22, 47, 27, 49, 43, 37, 5, 20, 0, 73, 22, 11, 57, 52, 72, 63, 62, 54, 74, 13, 26, 73, 7, 31, 64, 66, 33, 30, 10, 37, 28, 64, 2, 56, 51, 53, 50, 25, 52, 71, 27, 32, 1, 7, 16, 20, 56, 71, 65, 58, 24, 3, 42, 67, 65, 38, 36, 55, 8, 10, 29, 0, 14, 46, 25, 6, 34, 43, 39, 4, 46, 15, 19, 2, 44, 32, 59, 18, 38, 59, 33, 61, 4, 8, 40, 9, 21, 31, 60, 51, 40, 1, 48, 68, 23, 36, 18, 26, 13, 3, 35, 70, 49, 69, 60};
 
int f[75][2], cur[75];
bool block[150], ok[150];
 
void Anna(int N, long long X, int K, int P[]){
	memset(cur, 0, sizeof(cur));
	for (int i = 0; i < 150; i++){
		f[g[i]][cur[g[i]]] = i;
		cur[g[i]]++;
	}
	memset(block, 0, sizeof(block));
	memset(ok, 0, sizeof(ok));
	for (int i = 0; i < K; i++) block[P[i]] = 1;
	for (int i = 0; i < 75; i++){
		if (X == 0) continue;
		int a = X%3+1, b = 0;
		if (!block[f[i][0]]) b++;
		if (!block[f[i][1]]) b += 2;
      	if (b < 3) continue;
		if ((a&b) == a){
			Set(f[i][0], a&1);
			Set(f[i][1], (a&2)>>1);
			ok[f[i][0]] = 1;
			ok[f[i][1]] = 1;
			X /= 3;
		}
	}
	for (int i = 0; i < N; i++)
		if (!ok[i]) Set(i, 0);
}
#include "Brunolib.h"
#include <bits/stdc++.h>
using namespace std;
 
const int g2[] = {45, 39, 34, 16, 24, 55, 54, 63, 19, 44, 41, 70, 61, 29, 57, 12, 72, 53, 42, 69, 48, 15, 11, 28, 66, 50, 17, 62, 58, 74, 35, 9, 68, 30, 45, 21, 47, 23, 5, 67, 41, 12, 14, 6, 17, 22, 47, 27, 49, 43, 37, 5, 20, 0, 73, 22, 11, 57, 52, 72, 63, 62, 54, 74, 13, 26, 73, 7, 31, 64, 66, 33, 30, 10, 37, 28, 64, 2, 56, 51, 53, 50, 25, 52, 71, 27, 32, 1, 7, 16, 20, 56, 71, 65, 58, 24, 3, 42, 67, 65, 38, 36, 55, 8, 10, 29, 0, 14, 46, 25, 6, 34, 43, 39, 4, 46, 15, 19, 2, 44, 32, 59, 18, 38, 59, 33, 61, 4, 8, 40, 9, 21, 31, 60, 51, 40, 1, 48, 68, 23, 36, 18, 26, 13, 3, 35, 70, 49, 69, 60};
 
int f2[75][2], cur2[75];
 
long long Bruno(int N, int A[]){
	memset(cur2, 0, sizeof(cur2));
	for (int i = 0; i < 150; i++){
		f2[g2[i]][cur2[g2[i]]] = i;
		cur2[g2[i]]++;
	}
	long long X = 0;
	for (int i = 74; i >= 0; i--){
		if (A[f2[i][0]] == 0 && A[f2[i][1]] == 0) continue;
		int tmp = A[f2[i][0]]+A[f2[i][1]]*2-1;
		X = X*3+tmp;
	}
	return X;
}
# 결과 실행 시간 메모리 Grader output
1 Partially correct 25 ms 2396 KB Output is partially correct - L* = 37
2 Partially correct 25 ms 2392 KB Output is partially correct - L* = 38
3 Partially correct 31 ms 2576 KB Output is partially correct - L* = 38
4 Partially correct 26 ms 2396 KB Output is partially correct - L* = 38
5 Partially correct 25 ms 2404 KB Output is partially correct - L* = 38
6 Partially correct 27 ms 2396 KB Output is partially correct - L* = 37
7 Partially correct 26 ms 2388 KB Output is partially correct - L* = 38
8 Partially correct 25 ms 2404 KB Output is partially correct - L* = 38
9 Partially correct 26 ms 2368 KB Output is partially correct - L* = 38
10 Partially correct 26 ms 2548 KB Output is partially correct - L* = 38
11 Partially correct 25 ms 2536 KB Output is partially correct - L* = 37
12 Partially correct 26 ms 2400 KB Output is partially correct - L* = 37
13 Partially correct 25 ms 2340 KB Output is partially correct - L* = 38
14 Partially correct 26 ms 2400 KB Output is partially correct - L* = 37
15 Partially correct 26 ms 2396 KB Output is partially correct - L* = 38
16 Partially correct 24 ms 2488 KB Output is partially correct - L* = 38
17 Partially correct 26 ms 2404 KB Output is partially correct - L* = 38
18 Partially correct 25 ms 2516 KB Output is partially correct - L* = 38
19 Partially correct 26 ms 2396 KB Output is partially correct - L* = 38
20 Partially correct 26 ms 2408 KB Output is partially correct - L* = 38
21 Partially correct 26 ms 2392 KB Output is partially correct - L* = 37
22 Partially correct 26 ms 2396 KB Output is partially correct - L* = 38
23 Partially correct 25 ms 2900 KB Output is partially correct - L* = 37
24 Partially correct 26 ms 2816 KB Output is partially correct - L* = 38
25 Partially correct 26 ms 2396 KB Output is partially correct - L* = 38
26 Partially correct 26 ms 2404 KB Output is partially correct - L* = 38
27 Partially correct 25 ms 2488 KB Output is partially correct - L* = 38
28 Partially correct 26 ms 2404 KB Output is partially correct - L* = 37
29 Partially correct 28 ms 2840 KB Output is partially correct - L* = 38
30 Partially correct 25 ms 2404 KB Output is partially correct - L* = 37
31 Partially correct 27 ms 2404 KB Output is partially correct - L* = 38
32 Partially correct 25 ms 2404 KB Output is partially correct - L* = 38
33 Partially correct 26 ms 2396 KB Output is partially correct - L* = 38
34 Partially correct 25 ms 2396 KB Output is partially correct - L* = 38
35 Partially correct 29 ms 2648 KB Output is partially correct - L* = 37
36 Partially correct 26 ms 2404 KB Output is partially correct - L* = 38
37 Partially correct 27 ms 2400 KB Output is partially correct - L* = 38
38 Partially correct 26 ms 2396 KB Output is partially correct - L* = 37
39 Partially correct 25 ms 2568 KB Output is partially correct - L* = 38
40 Partially correct 26 ms 2588 KB Output is partially correct - L* = 38