Submission #338969

# Submission time Handle Problem Language Result Execution time Memory
338969 2020-12-24T10:36:53 Z nandonathaniel cmp (balkan11_cmp) C++14
73 / 100
1830 ms 82668 KB
#include "cmp.h"
#include "bits/stdc++.h"
using namespace std;

void remember(int n) {
	for(int i=5;i>=0;i--){
		int x=n & (1<<(2*i+1));
		int y=n & (1<<(2*i));
		if(x==0){
			if(y==0){
				bit_set(i*4+1);
			}
			else{
				bit_set(i*4+2);
			}
		}
		else{
			if(y==0){
				bit_set(i*4+3);
			}
			else{
				bit_set(i*4+4);
			}
		}
	}
}

int compare(int a) {
	for(int i=5;i>=0;i--){
		int x=a & (1<<(2*i+1));
		int y=a & (1<<(2*i));
		if(x==0){
			if(y==0){
				if(!bit_get(i*4+1))return -1;
			}
			else{
				if(!bit_get(i*4+2)){
					if(bit_get(i*4+1))return 1;
					else return -1;
				}
			}
		}
		else{
			if(y==0){
				if(!bit_get(i*4+3)){
					if(bit_get(i*4+4))return -1;
					else return 1;
				}
			}
			else{
				if(!bit_get(i*4+4))return 1;
			}
		}
	}
	return 0;
}
# Verdict Execution time Memory Grader output
1 Partially correct 1830 ms 82668 KB Output is partially correct - maxAccess = 13, score = 73