# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1262009 | Szymon_Pilipczuk | Broken Device (JOI17_broken_device) | C++20 | 0 ms | 320 KiB |
#include "Annalib.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define st first
#define nd second
#define pb push_back
#define all(a) a.begin(),a.end()
#define rep(a,b) for(int a = 0;a<b;a++)
const int inf = 1e9;
const ll infl = 1e18;
void Anna(int n, ll x,int k,int p[])
{
int i =0;
int j = 0;
while(i < n)
{
if(j == k || p[j] > i+2)
{
Set(i,1);
Set(i+1,x%2);
x/=2;
Set(i+2,x%2);
x/=2;
i+=3;
}
else
{
if(p[j] == i)
{
j++;
}
Set(i,0);
i++;
}
}
}
#include "Brunolib.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define st first
#define nd second
#define pb push_back
#define all(a) a.begin(),a.end()
#define rep(a,b) for(int a = 0;a<b;a++)
const int inf = 1e9;
const ll infl = 1e18;
ll Bruno(int n,int a[])
{
int j = 0;
ll ans = 0;
int i = 0;
while(i < n)
{
if(a[i] == 1)
{
ans += (1LL<<j) * a[i+1];
j++;
ans += (1LL<<j) * a[i+2];
i+=3;
}
else
{
i++;
}
}
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |