| # | Time | Username | Problem | Language | Result | Execution time | Memory | 
|---|---|---|---|---|---|---|---|
| 1219989 | goduadzesaba | Broken Device (JOI17_broken_device) | C++20 | 19 ms | 1344 KiB | 
#include "Annalib.h"
//#include "grader.cpp"
#include <bits/stdc++.h>
using namespace std;
void Anna(int N, long long X, int K, int P[] ){
	int bl[N],cur=0;
	for (int i=0; i<N; i++) bl[i]=0;
	for (int i=0; i<K; i++) bl[P[i]]=1;
	for (int i=0; i+2<N; i+=3){
		if (bl[i]+bl[i+1]+bl[i+2]>1 || cur>60){
			Set(i,0); Set(i+1,0); Set(i+2,0); continue;
		}
		if (bl[i]+bl[i+1]+bl[i+2]==0){
			static int x=((X>>cur)&3); cur+=2;
			if (x==0){
				Set(i,1); Set(i+1,0); Set(i+2,0);
			}
			if (x==1){
				Set(i,1); Set(i+1,0); Set(i+2,1);
			}
			if (x==2){
				Set(i,0); Set(i+1,1); Set(i+2,1);
			}
			if (x==3){
				Set(i,1); Set(i+1,1); Set(i+2,1);
			} continue;
		}
		static int x=((X>>cur)&1); cur++;
		if (bl[i]){
			if (x==0){
				Set(i,0); Set(i+1,1); Set(i+2,0);
			}
			else{
				Set(i,0); Set(i+1,0); Set(i+2,1);
			}
		}
		if (bl[i+1]){
			if (x==0){
				static int y=((X>>cur)&1); cur++;
				if (y==0){
					Set(i,1); Set(i+1,0); Set(i+2,0);
				}
				else{
					Set(i,1); Set(i+1,0); Set(i+2,1);
				}
			}
			else{
				Set(i,0); Set(i+1,0); Set(i+2,1);
			}
		}
		if (bl[i+2]){
			if (x==0){
				Set(i,0); Set(i+1,1); Set(i+2,0);
			}
			else{
				Set(i,1); Set(i+1,1); Set(i+2,0);
			}
		}
	} return;
}
#include "Brunolib.h"
//#include "grader.cpp"
#include <bits/stdc++.h>
using namespace std;
long long Bruno( int N, int A[] ){
	vector <int> bt;
	for (int i=0; i<N; i++){
		if (A[i]==1) bt.push_back(1);
		if (A[i]==2) bt.push_back(0);
		if (A[i]==3) bt.push_back(1),bt.push_back(0);
		if (A[i]==4) bt.push_back(0),bt.push_back(0);
		if (A[i]==5) bt.push_back(0),bt.push_back(1);
		if (A[i]==6) bt.push_back(1);
		if (A[i]==7) bt.push_back(1),bt.push_back(1);
	}
	static long long pw=1,ans=0; 
	for (int i:bt){
		ans+=pw*i; pw*=2;
	}
	return ans;
}
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
