답안 #131714

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
131714 2019-07-17T13:19:29 Z MohamedAhmed04 Broken Device (JOI17_broken_device) C++14
85 / 100
59 ms 3400 KB
#include "Annalib.h"
#include <bits/stdc++.h>

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

using namespace std ;

long long Bruno( int N, int A[] )
{
   long long ans = 0ll ;
   vector<int>v ;
   for(int i = 0 ; i < N-1 ; i += 2)
   {
      if(A[i] == 0 && A[i+1] == 0)
        continue ;
      if(A[i] == 0 && A[i+1] == 1)
        v.push_back(0) ;
      else if(A[i] == 1 && A[i+1] == 0)
        v.push_back(1) ;
      else if(A[i] == 1 && A[i+1] == 1)
        v.push_back(2) ;
   }
   reverse(v.begin() , v.end()) ;
   for(auto &i : v)
      ans = ans * 3ll + i * 1ll ;
   return ans;    
}
# 결과 실행 시간 메모리 Grader output
1 Partially correct 40 ms 3400 KB Output is partially correct - L* = 37
2 Partially correct 45 ms 3056 KB Output is partially correct - L* = 37
3 Partially correct 40 ms 3056 KB Output is partially correct - L* = 37
4 Partially correct 41 ms 3056 KB Output is partially correct - L* = 37
5 Partially correct 40 ms 3056 KB Output is partially correct - L* = 37
6 Partially correct 40 ms 3200 KB Output is partially correct - L* = 37
7 Partially correct 40 ms 3064 KB Output is partially correct - L* = 37
8 Partially correct 40 ms 3096 KB Output is partially correct - L* = 37
9 Partially correct 41 ms 3056 KB Output is partially correct - L* = 37
10 Partially correct 40 ms 3056 KB Output is partially correct - L* = 37
11 Partially correct 40 ms 3056 KB Output is partially correct - L* = 37
12 Partially correct 40 ms 3048 KB Output is partially correct - L* = 37
13 Partially correct 41 ms 3056 KB Output is partially correct - L* = 37
14 Partially correct 41 ms 3056 KB Output is partially correct - L* = 37
15 Partially correct 41 ms 3056 KB Output is partially correct - L* = 37
16 Partially correct 45 ms 3056 KB Output is partially correct - L* = 37
17 Partially correct 40 ms 3064 KB Output is partially correct - L* = 37
18 Partially correct 40 ms 3056 KB Output is partially correct - L* = 37
19 Partially correct 40 ms 3056 KB Output is partially correct - L* = 37
20 Partially correct 41 ms 3000 KB Output is partially correct - L* = 37
21 Partially correct 40 ms 3056 KB Output is partially correct - L* = 37
22 Partially correct 40 ms 3048 KB Output is partially correct - L* = 37
23 Partially correct 43 ms 3056 KB Output is partially correct - L* = 37
24 Partially correct 40 ms 3056 KB Output is partially correct - L* = 37
25 Partially correct 40 ms 2920 KB Output is partially correct - L* = 37
26 Partially correct 40 ms 3080 KB Output is partially correct - L* = 37
27 Partially correct 43 ms 3056 KB Output is partially correct - L* = 37
28 Partially correct 40 ms 3056 KB Output is partially correct - L* = 37
29 Partially correct 40 ms 3056 KB Output is partially correct - L* = 37
30 Partially correct 41 ms 3056 KB Output is partially correct - L* = 37
31 Partially correct 41 ms 3056 KB Output is partially correct - L* = 37
32 Partially correct 41 ms 3056 KB Output is partially correct - L* = 37
33 Partially correct 59 ms 3056 KB Output is partially correct - L* = 37
34 Partially correct 40 ms 2944 KB Output is partially correct - L* = 37
35 Partially correct 44 ms 3000 KB Output is partially correct - L* = 37
36 Partially correct 40 ms 2920 KB Output is partially correct - L* = 37
37 Partially correct 41 ms 3056 KB Output is partially correct - L* = 37
38 Partially correct 41 ms 2896 KB Output is partially correct - L* = 37
39 Partially correct 41 ms 3000 KB Output is partially correct - L* = 37
40 Partially correct 40 ms 2968 KB Output is partially correct - L* = 37