Submission #70578

#TimeUsernameProblemLanguageResultExecution timeMemory
70578InovakBroken Device (JOI17_broken_device)C++14
0 / 100
601 ms4824 KiB
#include "Annalib.h" #include <bits/stdc++.h> #define fr first #define sc second #define pb push_back #define mk make_pair #define ll long long #define OK puts("OK"); #define sz(s) (int)s.size() #define all(s) s.begin(), s.end() using namespace std; int u[1000]; void Anna( int N, long long X, int K, int P[] ) { int cnt = 0, cn = 0; for(int i = 0; i < K; i++) u[P[i]] = 1; for( int i = 0; i < N - 1; i++) { if(u[i] || u[i + 1] || cnt >= 60) { Set(i, 0); cerr << 0 << " "; cn++; } else { cerr << 1 << " " << ((X & (1ll << cnt)) ? 1 : 0) << " "; Set(i, 1); Set(i + 1, ((X & (1ll << cnt)) ? 1 : 0)); cn += 2; cnt++; i++; } } if(cn < N) Set(N - 1, 0), cerr << 0 << " "; cerr << endl; }
#include "Brunolib.h" long long Bruno( int N, int A[] ) { long long cnt = 0; long long X = 0; for(int i = 0; i < N - 1; i++) { if(A[i] == 1 && A[i + 1] == 1) { X += (1ll << cnt); cnt++; i++; } else if(A[i] == 1) { cnt++; i++; } } return X; }
#Verdict Execution timeMemoryGrader output
Fetching results...