답안 #100912

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
100912 2019-03-15T06:14:29 Z Pro_ktmr Broken Device (JOI17_broken_device) C++14
0 / 100
66 ms 3312 KB
#include"bits/stdc++.h"
using namespace std;
#define LL long long
#define MP make_pair
#include"Annalib.h"

static vector<int> keta(LL X, int i){
	vector<int> re;
	while(X > 0){
		re.push_back(X%i);
		X /= i;
	}
	return re;
}

static LL make(vector<int> v, int i){
	LL re = 0;
	for(int j=v.size()-1; j>=0; j--){
		re += i;
		re += v[j];
	}
	return re;
}

//void Set(int pos, int bit)
//N=150
void Anna(int N, long long X, int K, int P[]){
	bool canUse[150];
	for(int i=0; i<N; i++) canUse[i] = true;
	for(int i=0; i<K; i++) canUse[P[i]] = false;
	vector<int> tmp = keta(X, 3);
	LL now = 0;
	for(int i=0; i+1<N; i+=2){
		if(now < tmp.size() && canUse[i] && canUse[i+1]){
			if(tmp[now] == 0){
				Set(i, 0);
				Set(i+1, 1);
			}
			if(tmp[now] == 1){
				Set(i, 1);
				Set(i+1, 0);
			}
			if(tmp[now] == 2){
				Set(i, 1);
				Set(i+1, 1);
			}
			now++;
		}
		else{
			Set(i, 0);
			Set(i+1, 0);
		}
	}
}
#include"bits/stdc++.h"
using namespace std;
#define LL long long
#define MP make_pair
#include"Brunolib.h"

static vector<int> keta(LL X, int i){
	vector<int> re;
	while(X > 0){
		re.push_back(X%i);
		X /= i;
	}
	return re;
}

static LL make(vector<int> v, int i){
	LL re = 0;
	for(int j=v.size()-1; j>=0; j--){
		re += i;
		re += v[j];
	}
	return re;
}

long long Bruno(int N, int A[]){
	vector<int> ans;
	for(int i=0; i+1<N; i+=2){
		if(A[i] == 0 && A[i+1] == 1){
			ans.push_back(0);
		}
		if(A[i] == 1 && A[i+1] == 0){
			ans.push_back(1);
		}
		if(A[i] == 1 && A[i+1] == 1){
			ans.push_back(2);
		}
	}
	return make(ans,3);
}

Compilation message

Anna.cpp: In function 'void Anna(int, long long int, int, int*)':
Anna.cpp:34:10: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   if(now < tmp.size() && canUse[i] && canUse[i+1]){
      ~~~~^~~~~~~~~~~~
Anna.cpp: At global scope:
Anna.cpp:16:11: warning: 'long long int make(std::vector<int>, int)' defined but not used [-Wunused-function]
 static LL make(vector<int> v, int i){
           ^~~~

Bruno.cpp:7:20: warning: 'std::vector<int> keta(long long int, int)' defined but not used [-Wunused-function]
 static vector<int> keta(LL X, int i){
                    ^~~~
# 결과 실행 시간 메모리 Grader output
1 Incorrect 45 ms 3056 KB Output isn't correct - L* = 0
2 Incorrect 51 ms 3312 KB Output isn't correct - L* = 0
3 Incorrect 66 ms 3056 KB Output isn't correct - L* = 0
4 Incorrect 63 ms 3064 KB Output isn't correct - L* = 0
5 Incorrect 40 ms 3056 KB Output isn't correct - L* = 0
6 Incorrect 39 ms 3072 KB Output isn't correct - L* = 0
7 Incorrect 41 ms 3072 KB Output isn't correct - L* = 0
8 Incorrect 47 ms 3072 KB Output isn't correct - L* = 0
9 Incorrect 47 ms 3056 KB Output isn't correct - L* = 0
10 Incorrect 43 ms 3072 KB Output isn't correct - L* = 0
11 Incorrect 43 ms 3056 KB Output isn't correct - L* = 0
12 Incorrect 49 ms 3056 KB Output isn't correct - L* = 0
13 Incorrect 55 ms 3056 KB Output isn't correct - L* = 0
14 Incorrect 56 ms 3072 KB Output isn't correct - L* = 0
15 Incorrect 57 ms 2960 KB Output isn't correct - L* = 0
16 Incorrect 44 ms 3056 KB Output isn't correct - L* = 0
17 Incorrect 40 ms 3056 KB Output isn't correct - L* = 0
18 Incorrect 63 ms 3056 KB Output isn't correct - L* = 0
19 Incorrect 40 ms 3072 KB Output isn't correct - L* = 0
20 Incorrect 39 ms 3056 KB Output isn't correct - L* = 0
21 Incorrect 44 ms 3072 KB Output isn't correct - L* = 0
22 Incorrect 65 ms 3312 KB Output isn't correct - L* = 0
23 Incorrect 45 ms 3160 KB Output isn't correct - L* = 0
24 Incorrect 56 ms 3056 KB Output isn't correct - L* = 0
25 Incorrect 56 ms 3000 KB Output isn't correct - L* = 0
26 Incorrect 40 ms 3072 KB Output isn't correct - L* = 0
27 Incorrect 45 ms 3072 KB Output isn't correct - L* = 0
28 Incorrect 49 ms 3312 KB Output isn't correct - L* = 0
29 Incorrect 37 ms 3072 KB Output isn't correct - L* = 0
30 Incorrect 38 ms 3072 KB Output isn't correct - L* = 0
31 Incorrect 60 ms 3000 KB Output isn't correct - L* = 0
32 Incorrect 41 ms 3056 KB Output isn't correct - L* = 0
33 Incorrect 45 ms 3072 KB Output isn't correct - L* = 0
34 Incorrect 51 ms 3312 KB Output isn't correct - L* = 0
35 Incorrect 55 ms 3072 KB Output isn't correct - L* = 0
36 Incorrect 49 ms 3072 KB Output isn't correct - L* = 0
37 Incorrect 44 ms 3032 KB Output isn't correct - L* = 0
38 Incorrect 45 ms 3072 KB Output isn't correct - L* = 0
39 Incorrect 37 ms 3064 KB Output isn't correct - L* = 0
40 Incorrect 43 ms 3056 KB Output isn't correct - L* = 0