답안 #1077270

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1077270 2024-08-27T04:28:07 Z LCJLY Broken Device (JOI17_broken_device) C++14
8 / 100
32 ms 2624 KB
#include "Annalib.h"
#include <bits/stdc++.h>
//#include "grader.cpp"
using namespace std;
 
#define show(x,y) cout << y << " " << #x << endl;
#define show2(x,y,i,j) cout << y << " " << #x << "  " << j << " " << #i << endl;
#define show3(x,y,i,j,p,q) cout << y << " " << #x << "  " << j << " " << i << "  " << q << " " << #p << endl;
#define show4(x,y) for(auto it:y) cout << it << " "; cout << #x << endl;
typedef pair<int,int>pii; 
 
void Anna(int n, long long val, int k, int p[]){
	bool amos[155];
	memset(amos,0,sizeof(amos));
	for(int x=0;x<k;x++){
		amos[p[x]]=true;
	}
	
	//[0,30)
	//[30,60)
	
	vector<int>v;
	for(int x=0;x<60;x++){
		if(val&(1LL<<x)) v.push_back(1);
		else v.push_back(0);
	}
	
	int ptr=0;
	for(int x=0;x<n;x+=2){
		if(ptr<(int)v.size()&&x+2<n&&!amos[x]&&!amos[x+2]){
			Set(x,1);
			Set(x+2,v[ptr]);
			ptr++;
			x+=2;
		}
		else Set(x,0);
	}
	for(int x=1;x<n;x+=2){
		if(ptr<(int)v.size()&&x+2<n&&!amos[x]&&!amos[x+2]){
			Set(x,1);
			Set(x+2,v[ptr]);
			ptr++;
			x+=2;
		}
		else Set(x,0);
	}
}
#include "Brunolib.h"
#include <bits/stdc++.h>
//#include "grader.cpp"
using namespace std;
 
#define show(x,y) cout << y << " " << #x << endl;
#define show2(x,y,i,j) cout << y << " " << #x << "  " << j << " " << #i << endl;
#define show3(x,y,i,j,p,q) cout << y << " " << #x << "  " << j << " " << i << "  " << q << " " << #p << endl;
#define show4(x,y) for(auto it:y) cout << it << " "; cout << #x << endl;
typedef pair<int,int>pii; 
 
long long Bruno(int n, int a[]){
	long long val=0;
	int cur=0;
	for(int x=0;x<n;x+=2){
		if(a[x]==1){
			if(a[x+2]==1){
				val+=1LL<<cur;
			}
			cur++;
			x+=2;
		}
	}
	for(int x=1;x<n;x+=2){
		if(a[x]==1){
			if(a[x+2]==1){
				val+=1LL<<cur;
			}
			cur++;
			x+=2;
		}
	}
	return val;
}
# 결과 실행 시간 메모리 Grader output
1 Partially correct 20 ms 2392 KB Output is partially correct - L* = 15
2 Partially correct 22 ms 2396 KB Output is partially correct - L* = 15
3 Partially correct 26 ms 2404 KB Output is partially correct - L* = 17
4 Partially correct 23 ms 2480 KB Output is partially correct - L* = 15
5 Partially correct 23 ms 2392 KB Output is partially correct - L* = 15
6 Partially correct 22 ms 2404 KB Output is partially correct - L* = 16
7 Partially correct 23 ms 2400 KB Output is partially correct - L* = 19
8 Partially correct 22 ms 2480 KB Output is partially correct - L* = 18
9 Partially correct 23 ms 2396 KB Output is partially correct - L* = 16
10 Partially correct 26 ms 2396 KB Output is partially correct - L* = 16
11 Partially correct 22 ms 2404 KB Output is partially correct - L* = 17
12 Partially correct 22 ms 2392 KB Output is partially correct - L* = 17
13 Partially correct 26 ms 2392 KB Output is partially correct - L* = 14
14 Partially correct 23 ms 2624 KB Output is partially correct - L* = 15
15 Partially correct 26 ms 2420 KB Output is partially correct - L* = 17
16 Partially correct 22 ms 2396 KB Output is partially correct - L* = 15
17 Partially correct 22 ms 2396 KB Output is partially correct - L* = 14
18 Partially correct 20 ms 2400 KB Output is partially correct - L* = 16
19 Partially correct 23 ms 2480 KB Output is partially correct - L* = 19
20 Partially correct 24 ms 2396 KB Output is partially correct - L* = 20
21 Partially correct 23 ms 2400 KB Output is partially correct - L* = 19
22 Partially correct 20 ms 2488 KB Output is partially correct - L* = 15
23 Partially correct 24 ms 2396 KB Output is partially correct - L* = 15
24 Partially correct 22 ms 2396 KB Output is partially correct - L* = 18
25 Partially correct 22 ms 2472 KB Output is partially correct - L* = 15
26 Partially correct 24 ms 2560 KB Output is partially correct - L* = 17
27 Partially correct 26 ms 2396 KB Output is partially correct - L* = 17
28 Partially correct 22 ms 2388 KB Output is partially correct - L* = 18
29 Partially correct 23 ms 2368 KB Output is partially correct - L* = 15
30 Partially correct 23 ms 2404 KB Output is partially correct - L* = 16
31 Partially correct 22 ms 2404 KB Output is partially correct - L* = 19
32 Partially correct 32 ms 2372 KB Output is partially correct - L* = 16
33 Partially correct 23 ms 2388 KB Output is partially correct - L* = 15
34 Partially correct 27 ms 2396 KB Output is partially correct - L* = 15
35 Partially correct 22 ms 2484 KB Output is partially correct - L* = 16
36 Partially correct 22 ms 2396 KB Output is partially correct - L* = 19
37 Partially correct 23 ms 2484 KB Output is partially correct - L* = 16
38 Partially correct 24 ms 2376 KB Output is partially correct - L* = 19
39 Partially correct 27 ms 2396 KB Output is partially correct - L* = 14
40 Partially correct 23 ms 2476 KB Output is partially correct - L* = 14