# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
21320 | 2017-04-13T07:34:13 Z | Ushio | Broken Device (JOI17_broken_device) | C++14 | 0 ms | 0 KB |
#include "Brunolib.h" #include <algorithm> #include <iostream> using namespace std; long long Bruno( int N, int A[] ){ bool validity = true; int bit = 0; int64_t ans = 0; for (int i = 0; i < N; ++i) { if (validity) { validity = A[i] == 0; } else { if (bit <= 59) { ans |= ((int64_t) A[i]) << bit; ++bit; } validity = true; } } return ans; }