# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1204024 | MuhammadSaram | Broken Device (JOI17_broken_device) | C++20 | 18 ms | 1344 KiB |
#include "Annalib.h"
#include <bits/stdc++.h>
using namespace std;
void Anna(int n, long long x, int k, int P[])
{
bool off[n]={};
for (int i=0;i<k;i++)
off[P[i]]=1;
for (int i=0;i<n;i++)
if (!off[i] && i+2<n && x)
Set(i,1),Set(i+1,x%4/2),Set(i+2,x%2),i+=2;
else
Set(i,0);
}
#include "Brunolib.h"
#include <bits/stdc++.h>
using namespace std;
long long Bruno(int n, int a[])
{
long long ans=0;
for (int i=n-1;i>=2;i--)
if (a[i-2])
ans=ans*4+a[i-1]*2+a[i],i-=2;
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |