Submission #68001

#TimeUsernameProblemLanguageResultExecution timeMemory
68001elitewantsyouBroken Device (JOI17_broken_device)C++14
0 / 100
78 ms13752 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 < K; i++){ gg[P[i]] = 1; } for(int i = 1; i < N; i += 2){ if(gg[i - 1] == 0 && gg[i] == 0 && gg[i + 1] == 0){ v.push_back(i); } } for(int i = 0; i < N; i++){ gg[i] = 0; } for(int i = 0; i < v.size(); i++){ gg[v[i] - 1] = gg[v[i] + 1] = 1; if(X & (1ll << i)){ gg[v[i]] = 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++){ if(i % 2 == 0){ c += A[i]; } else{ if(c % 2){ X += (1ll << g) * A[i]; g++; } } } return X; }

Compilation message (stderr)

Anna.cpp: In function 'void Anna(int, long long int, int, int*)':
Anna.cpp:22:26: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         for(int i = 0; i < v.size(); i++){
                        ~~^~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...