# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
959085 | De3b0o | Broken Device (JOI17_broken_device) | C++14 | 50 ms | 2932 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "Annalib.h"
#include<bits/stdc++.h>
#define ll long long
#define F first
#define S second
#define in insert
#define pb push_back
#define ppb pop_back()
#define d3 ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define cans cout << ans << "\n";
#define yes cout << "Yes" << "\n";
#define no cout << "No" << "\n";
#define pll pair<ll,ll>
#define lin cout << "\n";
#define sqr 340
#define mod 1000000007
#define mid ((l+r)/2)
#define lc (2*n)
#define rc (2*n+1)
using namespace std;
void Anna(int N, long long X, int K, int P[])
{
ll b = 1;
map<ll,bool> mp;
for(int i = 0 ; K>i ; i++)
mp[P[i]]=1;
for(int i = 0 ; 150>i ; i+=2)
{
if(b&X)
{
if(mp[i]==1||mp[i+1]==1)
{
Set(i,0);
Set(i+1,0);
continue;
}
Set(i,1);
Set(i+1,1);
b*=2;
}
else
{
if(mp[i]==1&&mp[i+1]==1)
{
Set(i,0);
Set(i+1,0);
continue;
}
if(mp[i]==1||mp[i+1]==1)
{
Set(i,1);
Set(i+1,1);
b*=2;
continue;
}
Set(i,1);
Set(i+1,0);
b*=2;
}
}
}
#include "Brunolib.h"
#include<bits/stdc++.h>
#define ll long long
#define F first
#define S second
#define in insert
#define pb push_back
#define ppb pop_back()
#define d3 ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define cans cout << ans << "\n";
#define yes cout << "Yes" << "\n";
#define no cout << "No" << "\n";
#define pll pair<ll,ll>
#define lin cout << "\n";
#define sqr 340
#define mod 1000000007
#define mid ((l+r)/2)
#define lc (2*n)
#define rc (2*n+1)
using namespace std;
long long Bruno( int N, int A[] )
{
ll b = 1;
ll ans = 0;
for(int i = 0 ; 150>i ; i+=2)
{
ll c = 0;
if(A[i]==1)
c++;
if(A[i+1]==1)
c++;
if(c==0)
continue;
if(c==2)
ans+=b;
b*=2;
}
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |