답안 #113949

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
113949 2019-05-29T09:42:44 Z anayk Broken Device (JOI17_broken_device) C++14
0 / 100
2000 ms 384 KB
#include "Annalib.h"
#include <iostream>

#define LOGX 60

void Anna(int N, long long X, int K, int P[])
{
	int bin[LOGX];
	long long pow[LOGX];
	
	pow[0] = 1;
	for(int i = 1; i < LOGX; i++)
		pow[i] = pow[i-1]*2;
	
	for(int i = LOGX - 1; i >= 0; i++)
	{
		if(pow[i] <= X)
		{
			bin[i] = 1;
			X -= pow[i];
		}
		else
			bin[i] = 0;
	}
	
	int cur = 0;
	int ptr = 0;
	int next = 0;
	
	while(ptr < 60)
	{
		if(P[next] - cur < 3)
		{
			Set(cur, 0);
			cur++;
		}
		else
		{
			Set(cur, 1);
			cur++;
			for(int i = 0; i < 2; i++)
				Set(cur++, bin[ptr++]);
		}
		
		if(P[next] < cur)
			next++;
	}
	
	while(cur < N)
	{
		Set(cur, 0);
		cur++;
	}
}
#include "Brunolib.h"

#define LOGX 60

long long Bruno(int N, int A[])
{
	long long pow[LOGX];
	
	pow[0] = 1;
	for(int i = 1; i < LOGX; i++)
		pow[i] = pow[i-1]*2;
	
	long long X = 0;
	int cur = 0;
	for(int i = 0; i < N; i++)
	{
		if(A[i] = 1)
		{
			for(int j = 0; j < 2; j++)
				if(A[++i])
					X += pow[cur++];
		}
	}
	
	return X;
}

Compilation message

Bruno.cpp: In function 'long long int Bruno(int, int*)':
Bruno.cpp:17:11: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
   if(A[i] = 1)
      ~~~~~^~~
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 2065 ms 384 KB Time limit exceeded
2 Execution timed out 2060 ms 256 KB Time limit exceeded
3 Execution timed out 2065 ms 256 KB Time limit exceeded
4 Execution timed out 2051 ms 256 KB Time limit exceeded
5 Execution timed out 2076 ms 256 KB Time limit exceeded
6 Execution timed out 2057 ms 256 KB Time limit exceeded
7 Execution timed out 2037 ms 384 KB Time limit exceeded
8 Execution timed out 2043 ms 256 KB Time limit exceeded
9 Execution timed out 2017 ms 384 KB Time limit exceeded
10 Execution timed out 2039 ms 256 KB Time limit exceeded
11 Execution timed out 2044 ms 256 KB Time limit exceeded
12 Execution timed out 2048 ms 384 KB Time limit exceeded
13 Execution timed out 2062 ms 256 KB Time limit exceeded
14 Execution timed out 2049 ms 384 KB Time limit exceeded
15 Execution timed out 2053 ms 384 KB Time limit exceeded
16 Execution timed out 2054 ms 384 KB Time limit exceeded
17 Execution timed out 2067 ms 384 KB Time limit exceeded
18 Execution timed out 2027 ms 384 KB Time limit exceeded
19 Execution timed out 2054 ms 384 KB Time limit exceeded
20 Execution timed out 2063 ms 384 KB Time limit exceeded
21 Execution timed out 2021 ms 384 KB Time limit exceeded
22 Execution timed out 2039 ms 384 KB Time limit exceeded
23 Execution timed out 2055 ms 384 KB Time limit exceeded
24 Execution timed out 2060 ms 384 KB Time limit exceeded
25 Execution timed out 2054 ms 256 KB Time limit exceeded
26 Execution timed out 2048 ms 256 KB Time limit exceeded
27 Execution timed out 2036 ms 256 KB Time limit exceeded
28 Execution timed out 2049 ms 256 KB Time limit exceeded
29 Execution timed out 2045 ms 256 KB Time limit exceeded
30 Execution timed out 2057 ms 256 KB Time limit exceeded
31 Execution timed out 2037 ms 256 KB Time limit exceeded
32 Execution timed out 2064 ms 256 KB Time limit exceeded
33 Execution timed out 2040 ms 256 KB Time limit exceeded
34 Execution timed out 2059 ms 256 KB Time limit exceeded
35 Execution timed out 2054 ms 256 KB Time limit exceeded
36 Execution timed out 2036 ms 256 KB Time limit exceeded
37 Execution timed out 2033 ms 256 KB Time limit exceeded
38 Execution timed out 2024 ms 256 KB Time limit exceeded
39 Execution timed out 2037 ms 256 KB Time limit exceeded
40 Execution timed out 2058 ms 256 KB Time limit exceeded