답안 #64224

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
64224 2018-08-03T14:06:29 Z zadrga Broken Device (JOI17_broken_device) C++14
0 / 100
570 ms 21552 KB
#include "Annalib.h"
#include <bits/stdc++.h>

using namespace std;
 
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define INF (1LL << 55)
#define MOD (1000 * 1000 * 1000 + 7)
#define maxn 1000111
 
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;

vector<int> v, block;
int arr[maxn];

void Anna(int N, long long X, int K, int P[]){
//	cout  << N << "  " << X  << "  " << K<< endl;
	v.clear(); block.clear();
	memset(arr, 0, sizeof(arr));

	for(int i = 0; i < 60; i++){
		if((X >> i) & 1)
			v.pb(1);
		else
			v.pb(0);
	}

	block.pb(-1);
	for(int i = 0; i < K; i++)
		block.pb(P[i]);
	block.pb(N + 1);

	memset(arr, 0, sizeof(arr));

	int ind = 0;
	for(int i = 1; i < block.size(); i++){
		int x = block[i - 1] + 1;

		while(ind < v.size() && block[i] - x >= 3){
			arr[x++] = 1;
			arr[x++] = v[ind++];
			arr[x++] = v[ind++];
		}
	}

	for(int i = 0; i < N; i++){
		Set(i, arr[i]);
//		cout << i << "  "<< arr[i] << endl;
	}
}
#include "Brunolib.h"
#include <bits/stdc++.h>

using namespace std;
 
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define INF (1LL << 55)
#define MOD (1000 * 1000 * 1000 + 7)
#define maxn 1000111
 
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;


vector<int> v1;

long long Bruno( int N, int A[]){
	v1.clear();
	for(int i = 0; i < N; i++){
		if(A[i] == 1){
			v1.pb(A[i + 1]);
			v1.pb(A[i + 2]);
			i += 2;
		}
	}

	ll ret = 0;
	for(int i = 0; i < v1.size(); i++)
		ret += (1 << i) * v1[i];

//	cout << ret << endl;

	return ret;
}

Compilation message

Anna.cpp: In function 'void Anna(int, long long int, int, int*)':
Anna.cpp:41:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for(int i = 1; i < block.size(); i++){
                 ~~^~~~~~~~~~~~~~
Anna.cpp:44:13: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   while(ind < v.size() && block[i] - x >= 3){
         ~~~~^~~~~~~~~~

Bruno.cpp: In function 'long long int Bruno(int, int*)':
Bruno.cpp:32:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for(int i = 0; i < v1.size(); i++)
                 ~~^~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Incorrect 547 ms 11408 KB Output isn't correct - L* = 0
2 Incorrect 568 ms 11976 KB Output isn't correct - L* = 0
3 Incorrect 525 ms 12304 KB Output isn't correct - L* = 0
4 Incorrect 518 ms 12480 KB Output isn't correct - L* = 0
5 Incorrect 540 ms 12792 KB Output isn't correct - L* = 0
6 Incorrect 549 ms 13264 KB Output isn't correct - L* = 0
7 Incorrect 480 ms 13608 KB Output isn't correct - L* = 0
8 Incorrect 523 ms 13920 KB Output isn't correct - L* = 0
9 Incorrect 507 ms 14304 KB Output isn't correct - L* = 0
10 Incorrect 528 ms 14520 KB Output isn't correct - L* = 0
11 Incorrect 537 ms 14960 KB Output isn't correct - L* = 0
12 Incorrect 533 ms 14960 KB Output isn't correct - L* = 0
13 Incorrect 546 ms 15096 KB Output isn't correct - L* = 0
14 Incorrect 551 ms 15384 KB Output isn't correct - L* = 0
15 Incorrect 529 ms 15496 KB Output isn't correct - L* = 0
16 Incorrect 503 ms 16024 KB Output isn't correct - L* = 0
17 Incorrect 515 ms 16504 KB Output isn't correct - L* = 0
18 Incorrect 541 ms 16504 KB Output isn't correct - L* = 0
19 Incorrect 492 ms 16504 KB Output isn't correct - L* = 0
20 Incorrect 513 ms 16784 KB Output isn't correct - L* = 0
21 Incorrect 462 ms 16928 KB Output isn't correct - L* = 0
22 Incorrect 544 ms 17624 KB Output isn't correct - L* = 0
23 Incorrect 472 ms 17632 KB Output isn't correct - L* = 0
24 Incorrect 502 ms 17848 KB Output isn't correct - L* = 0
25 Incorrect 531 ms 17848 KB Output isn't correct - L* = 0
26 Incorrect 547 ms 18032 KB Output isn't correct - L* = 0
27 Incorrect 550 ms 18488 KB Output isn't correct - L* = 0
28 Incorrect 502 ms 18840 KB Output isn't correct - L* = 0
29 Incorrect 551 ms 18840 KB Output isn't correct - L* = 0
30 Incorrect 459 ms 19088 KB Output isn't correct - L* = 0
31 Incorrect 567 ms 19320 KB Output isn't correct - L* = 0
32 Incorrect 492 ms 19520 KB Output isn't correct - L* = 0
33 Incorrect 520 ms 19960 KB Output isn't correct - L* = 0
34 Incorrect 502 ms 20160 KB Output isn't correct - L* = 0
35 Incorrect 516 ms 20296 KB Output isn't correct - L* = 0
36 Incorrect 531 ms 20808 KB Output isn't correct - L* = 0
37 Incorrect 556 ms 20808 KB Output isn't correct - L* = 0
38 Incorrect 539 ms 20936 KB Output isn't correct - L* = 0
39 Incorrect 570 ms 21168 KB Output isn't correct - L* = 0
40 Incorrect 471 ms 21552 KB Output isn't correct - L* = 0