제출 #1204036

#제출 시각아이디문제언어결과실행 시간메모리
1204036MuhammadSaramBroken Device (JOI17_broken_device)C++20
0 / 100
18 ms1344 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;
	int p=59;
	for (int i=0;i<n;i++)
	{
		if (off[i])
			Set(i,0);
		else
		{
			if (i+1<n && !off[i+1])
				Set(i,1),Set(i+1,(x>>p)%2),i++,p--;
			else if((x>>p)%2==0 && i+1<n)
				Set(i,1),Set(i+1,0),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 timeMemoryGrader output
Fetching results...