Submission #340978

#TimeUsernameProblemLanguageResultExecution timeMemory
340978rqiBroken Device (JOI17_broken_device)C++14
0 / 100
36 ms3384 KiB
#include "Annalib.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<int> vi; vi res(150, 0); bool bad[150]; void Anna( int N, ll _X, int K, int P[] ){ bitset<60> X = bitset<60>(_X); for(int i = 0; i < K; i++){ bad[P[i]] = 1; } bool frontbad = 0; for(int i = 0; i < 60; i++){ if(bad[i]) frontbad = 1; } if(!frontbad){ for(int i = 0; i < 60; i++){ res[i] = X[i]; } } else{ for(int i = 0; i < 60; i++){ res[90+i] = X[i]; } } for(int i = 0; i < N; i++){ Set(i, res[i]); cout << res[i]; } cout << "\n"; }
#include "Brunolib.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; long long Bruno( int N, int A[] ){ bool frontbad = 1; for(int i = 0; i < 60; i++){ if(A[i] == 1) frontbad = 0; } bitset<60> X; if(!frontbad){ for(int i = 0; i < 60; i++){ X[i] = A[i]; } } else{ for(int i = 0; i < 60; i++){ X[i] = A[90+i]; } } cout << ll(X.to_ulong()) << "\n"; return ll(X.to_ulong()); }
#Verdict Execution timeMemoryGrader output
Fetching results...