답안 #138143

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
138143 2019-07-29T12:24:16 Z Retro3014 Broken Device (JOI17_broken_device) C++17
85 / 100
45 ms 3568 KB
#include "Annalib.h"
#include <bits/stdc++.h>

#define pb push_back
#define all(v) ((v).begin(), (v).end())
#define sortv(v) sort(all(v))
#define sz(v) ((int)(v).size())
#define uniqv(v) (v).erase(unique(all(v)), (v).end())
#define umax(a, b) (a)=max((a), (b))
#define umin(a, b) (a)=min((a), (b))
#define FOR(i,a,b) for(int i = (a); i <= (b); i++)
#define rep(i,n) FOR(i,1,n)
#define rep0(i,n) FOR(i,0,(int)(n)-1)
#define FI first
#define SE second
#define INF 2000000000
#define INFLL 1000000000000000000LL


using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

const int MAX_N = 150;

bool chk[MAX_N+1];

void Anna( int N, long long X, int K, int P[]){
	for(int i=0; i<N; i++)	chk[i] = false;
	for(int i=0; i<K; i++){
		chk[P[i]] = true;
	}
	for(int i = 0; i < N; i+=2){
		if(chk[i] || chk[i+1])	{
			Set(i, 0);
			Set(i+1, 0);
			continue;
		}
		if(X%(ll)3==0){
			Set(i, 1);
			Set(i+1, 1);
		}else if(X%(ll)3==1){
			Set(i, 1);
			Set(i+1, 0);
		}else{
			Set(i, 0);
			Set(i+1, 1);
		}
		X/=(ll)3;
	}
}
#include "Brunolib.h"
#include <bits/stdc++.h>

#define pb push_back
#define all(v) ((v).begin(), (v).end())
#define sortv(v) sort(all(v))
#define sz(v) ((int)(v).size())
#define uniqv(v) (v).erase(unique(all(v)), (v).end())
#define umax(a, b) (a)=max((a), (b))
#define umin(a, b) (a)=min((a), (b))
#define FOR(i,a,b) for(int i = (a); i <= (b); i++)
#define rep(i,n) FOR(i,1,n)
#define rep0(i,n) FOR(i,0,(int)(n)-1)
#define FI first
#define SE second
#define INF 2000000000
#define INFLL 1000000000000000000LL


using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;




long long Bruno( int N, int A[] ){
	ll ans = 0;
	ll thr = 1;
	for(int i=0; i<N; i+=2){
		if(A[i]==0 && A[i+1]==0)	continue;
		if(A[i]==1 && A[i+1]==0){
			ans += 1 * thr;
		}else if(A[i]==0 && A[i+1]==1){
			ans += 2 * thr;
		}
		thr*=(ll)3;
	}
	//cout<<ans;
	return ans;
}
# 결과 실행 시간 메모리 Grader output
1 Partially correct 40 ms 3056 KB Output is partially correct - L* = 37
2 Partially correct 39 ms 3312 KB Output is partially correct - L* = 37
3 Partially correct 40 ms 3072 KB Output is partially correct - L* = 37
4 Partially correct 40 ms 3056 KB Output is partially correct - L* = 37
5 Partially correct 39 ms 3312 KB Output is partially correct - L* = 37
6 Partially correct 40 ms 3152 KB Output is partially correct - L* = 37
7 Partially correct 39 ms 3056 KB Output is partially correct - L* = 37
8 Partially correct 41 ms 3056 KB Output is partially correct - L* = 37
9 Partially correct 39 ms 3064 KB Output is partially correct - L* = 37
10 Partially correct 40 ms 3312 KB Output is partially correct - L* = 37
11 Partially correct 40 ms 3032 KB Output is partially correct - L* = 37
12 Partially correct 41 ms 3056 KB Output is partially correct - L* = 37
13 Partially correct 39 ms 3264 KB Output is partially correct - L* = 37
14 Partially correct 41 ms 3312 KB Output is partially correct - L* = 37
15 Partially correct 39 ms 3056 KB Output is partially correct - L* = 37
16 Partially correct 40 ms 3568 KB Output is partially correct - L* = 37
17 Partially correct 39 ms 3312 KB Output is partially correct - L* = 37
18 Partially correct 39 ms 3312 KB Output is partially correct - L* = 37
19 Partially correct 40 ms 3312 KB Output is partially correct - L* = 37
20 Partially correct 40 ms 3056 KB Output is partially correct - L* = 37
21 Partially correct 39 ms 3312 KB Output is partially correct - L* = 37
22 Partially correct 39 ms 3056 KB Output is partially correct - L* = 37
23 Partially correct 45 ms 3312 KB Output is partially correct - L* = 37
24 Partially correct 39 ms 3032 KB Output is partially correct - L* = 37
25 Partially correct 39 ms 3312 KB Output is partially correct - L* = 37
26 Partially correct 39 ms 3056 KB Output is partially correct - L* = 37
27 Partially correct 43 ms 3312 KB Output is partially correct - L* = 37
28 Partially correct 40 ms 3312 KB Output is partially correct - L* = 37
29 Partially correct 40 ms 3312 KB Output is partially correct - L* = 37
30 Partially correct 39 ms 3312 KB Output is partially correct - L* = 37
31 Partially correct 39 ms 3312 KB Output is partially correct - L* = 37
32 Partially correct 40 ms 3056 KB Output is partially correct - L* = 37
33 Partially correct 40 ms 3216 KB Output is partially correct - L* = 37
34 Partially correct 39 ms 3312 KB Output is partially correct - L* = 37
35 Partially correct 40 ms 3312 KB Output is partially correct - L* = 37
36 Partially correct 40 ms 3312 KB Output is partially correct - L* = 37
37 Partially correct 39 ms 3312 KB Output is partially correct - L* = 37
38 Partially correct 39 ms 3312 KB Output is partially correct - L* = 37
39 Partially correct 39 ms 3056 KB Output is partially correct - L* = 37
40 Partially correct 39 ms 3056 KB Output is partially correct - L* = 37