Submission #68007

#TimeUsernameProblemLanguageResultExecution timeMemory
68007elitewantsyouBroken Device (JOI17_broken_device)C++14
41 / 100
87 ms3744 KiB
#include <bits/stdc++.h> #include "Annalib.h" using namespace std; int gg[1111]; void Anna( int N, long long X, int K, int P[] ) { vector < int > v; for(int i = 0; i < N; i++){ gg[i] = 0; } for(int i = 0; i < K; i++){ gg[P[i]] = 1; } for(int i = 0; i < N; i += 2){ if(gg[i] == 0 && gg[i + 1] == 0){ v.push_back(i); //cout << i << " "; } } //cout << endl; for(int i = 0; i < N; i++){ gg[i] = 0; } for(int i = 0; i < min(61, (int)v.size()); i++){ gg[v[i]] = 1; if(X & (1ll << i)){ gg[v[i] + 1] = 1; } } for(int i = 0; i < N; i++){ Set(i, gg[i]); } }
#include "Brunolib.h" long long Bruno( int N, int A[] ) { long long X = 0; int c = 0, g = 0; for(int i = 0; i < N; i += 2){ if(A[i]){ X += (1ll << g) * A[i + 1]; g++; } } return X; }

Compilation message (stderr)

Bruno.cpp: In function 'long long int Bruno(int, int*)':
Bruno.cpp:6:13: warning: unused variable 'c' [-Wunused-variable]
         int c = 0, g = 0;
             ^
#Verdict Execution timeMemoryGrader output
Fetching results...