# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1203991 | MuhammadSaram | Broken Device (JOI17_broken_device) | C++20 | 19 ms | 1564 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]]=off[max(0,P[i]-1)]=1;
int p=59;
for (int i=0;i<n;i++)
if (!off[i] && p>=0 && i+1<n)
Set(i,1),Set(i+1,(x>>p)%2),i++,p--;
else
Set(i,0);
}
#include "Brunolib.h"
#include <bits/stdc++.h>
using namespace std;
long long Bruno(int n, int a[])
{
int p=59;
long long ans=0;
for (int i=0;i<n;i++)
if (a[i])
ans+=(1ll<<p)*a[i+1],i++,p--;
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |