# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1204082 | Ghulam_Junaid | Broken Device (JOI17_broken_device) | C++20 | 27 ms | 1588 KiB |
#include <bits/stdc++.h>
#include "Annalib.h"
using namespace std;
typedef long long ll;
void Anna(int n, ll X, int m, int pos[] ){
int i = 0, b = 0, p = 0;
while (i < n){
if (b >= 60){
Set(i, 0);
i++;
continue;
}
while (p < m and pos[p] < i)
p++;
if (p < m and pos[p] == i){
Set(i, 0);
i++;
continue;
}
if (p < m and pos[p] == i + 1){
if ((1ll << b) & X){
Set(i, 0);
i++;
continue;
}
Set(i, 1);
i++;
b++;
continue;
}
Set(i, 1);
i++;
if (i == n) break;
if ((1ll << b) & X)
Set(i, 1);
else
Set(i, 0);
i++;
b++;
}
}
#include <bits/stdc++.h>
#include "Brunolib.h"
using namespace std;
typedef long long ll;
ll Bruno(int N, int A[]){
int i = 0;
ll b = 0;
ll x = 0;
while (i + 1 < N){
if (b >= 60)
return x;
if (!A[i]){
i++;
continue;
}
x += (1ll << b) * (A[i + 1]);
i += 2;
b++;
}
return x;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |