답안 #21130

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
21130 2017-04-05T02:42:12 Z khsoo01 Broken Device (JOI17_broken_device) C++11
85 / 100
65 ms 3736 KB
#include "Annalib.h"
#include <bits/stdc++.h>
using namespace std;
bool cant[155];

void Anna( int N, long long X, int K, int P[] ){
	for(int i=0;i<N;i++) cant[i] = false;
	for(int i=0;i<K;i++) cant[P[i]] = true;
	vector<int> tri;
	long long T = X;
	for(int i=0;i<38;i++) {
		tri.push_back(T%3+1);
		T /= 3;
	}
	reverse(tri.begin(), tri.end());
	int idx = 0;
	for(int i=0;i<N;i+=2) {
		if(cant[i] || cant[i+1] || idx >= tri.size()) {
			Set(i, 0); Set(i+1, 0);
		}
		else {
			Set(i, tri[idx]/2); Set(i+1, tri[idx]%2);
			idx++;
		}
	}
}
#include "Brunolib.h"

long long Bruno( int N, int A[] ){
	long long ret = 0;
	for(int i=0;i<N;i+=2) {
		int cur = A[i] * 2 + A[i+1];
		if(!cur) continue;
		ret *= 3; ret += cur-1;
	}
	return ret;
}

Compilation message

Anna.cpp: In function 'void Anna(int, long long int, int, int*)':
Anna.cpp:18:34: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   if(cant[i] || cant[i+1] || idx >= tri.size()) {
                                  ^



# 결과 실행 시간 메모리 Grader output
1 Partially correct 39 ms 3736 KB Output is partially correct - L* = 37
2 Partially correct 35 ms 3736 KB Output is partially correct - L* = 37
3 Partially correct 35 ms 3736 KB Output is partially correct - L* = 37
4 Partially correct 32 ms 3736 KB Output is partially correct - L* = 37
5 Partially correct 32 ms 3736 KB Output is partially correct - L* = 37
6 Partially correct 39 ms 3736 KB Output is partially correct - L* = 37
7 Partially correct 35 ms 3736 KB Output is partially correct - L* = 37
8 Partially correct 32 ms 3736 KB Output is partially correct - L* = 37
9 Partially correct 35 ms 3736 KB Output is partially correct - L* = 37
10 Partially correct 28 ms 3736 KB Output is partially correct - L* = 37
11 Partially correct 39 ms 3736 KB Output is partially correct - L* = 37
12 Partially correct 39 ms 3736 KB Output is partially correct - L* = 37
13 Partially correct 32 ms 3736 KB Output is partially correct - L* = 37
14 Partially correct 55 ms 3736 KB Output is partially correct - L* = 37
15 Partially correct 49 ms 3736 KB Output is partially correct - L* = 37
16 Partially correct 55 ms 3736 KB Output is partially correct - L* = 37
17 Partially correct 35 ms 3736 KB Output is partially correct - L* = 37
18 Partially correct 32 ms 3736 KB Output is partially correct - L* = 37
19 Partially correct 39 ms 3736 KB Output is partially correct - L* = 37
20 Partially correct 52 ms 3736 KB Output is partially correct - L* = 37
21 Partially correct 49 ms 3736 KB Output is partially correct - L* = 37
22 Partially correct 25 ms 3736 KB Output is partially correct - L* = 37
23 Partially correct 28 ms 3736 KB Output is partially correct - L* = 37
24 Partially correct 32 ms 3736 KB Output is partially correct - L* = 37
25 Partially correct 39 ms 3736 KB Output is partially correct - L* = 37
26 Partially correct 39 ms 3736 KB Output is partially correct - L* = 37
27 Partially correct 35 ms 3736 KB Output is partially correct - L* = 37
28 Partially correct 35 ms 3736 KB Output is partially correct - L* = 37
29 Partially correct 32 ms 3736 KB Output is partially correct - L* = 37
30 Partially correct 38 ms 3736 KB Output is partially correct - L* = 37
31 Partially correct 39 ms 3736 KB Output is partially correct - L* = 37
32 Partially correct 32 ms 3736 KB Output is partially correct - L* = 37
33 Partially correct 32 ms 3736 KB Output is partially correct - L* = 37
34 Partially correct 35 ms 3736 KB Output is partially correct - L* = 37
35 Partially correct 39 ms 3736 KB Output is partially correct - L* = 37
36 Partially correct 28 ms 3736 KB Output is partially correct - L* = 37
37 Partially correct 32 ms 3736 KB Output is partially correct - L* = 37
38 Partially correct 65 ms 3736 KB Output is partially correct - L* = 37
39 Partially correct 32 ms 3736 KB Output is partially correct - L* = 37
40 Partially correct 28 ms 3736 KB Output is partially correct - L* = 37