Submission #100040

#TimeUsernameProblemLanguageResultExecution timeMemory
100040cheehengBroken Device (JOI17_broken_device)C++14
8 / 100
109 ms3312 KiB
#include "Annalib.h" #include <bits/stdc++.h> using namespace std; //void Set( int pos, int bit ); void Anna( int N, long long X, int K, int P[] ){ if(K >= -123){ bool check = true; for(int i = 0; i < 60; i ++){ if(binary_search(P, P+K, i) && ((X&(1LL<<i)) != 0)){ check = false; break; } } if(check){ for(int i = 0; i < 60; i ++){ Set(i, (X&(1LL<<i)) != 0); } for(int i = 60; i < 150; i ++){ Set(i, 0); } return; } if(true){ for(int i = 0; i < 60; i ++){ Set(i + 90, (X&(1LL<<i)) != 0); } for(int i = 0; i < 90; i ++){ Set(i, 0); } return; }else{ for(int i = 0; i < 150; i ++){ Set(i, 0); } } }else{ throw; } }
#include "Brunolib.h" #include <bits/stdc++.h> using namespace std; long long Bruno( int N, int A[] ){ long long X1 = 0; long long X2 = 0; for(int i = 0; i < 60; i ++){ X1 |= ((long long)A[i]<<i); } for(int i = 0; i < 60; i ++){ X2 |= ((long long)A[i+90]<<i); } if(X1 == 0 && X2 == 0){ //printf("%lld\n", 0); return 0LL; }else if(X1 == 0){ //printf("%lld\n", X2); return X2; }else{ //printf("%lld\n", X1); return X1; } }
#Verdict Execution timeMemoryGrader output
Fetching results...