# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
959479 | edogawa_something | Broken Device (JOI17_broken_device) | C++17 | 34 ms | 2940 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<bits/stdc++.h>
#include "Annalib.h"
using namespace std;
typedef long long ll;
typedef vector<ll> vii;
typedef pair<ll,ll> pii;
#define F first
#define S second
#define pb push_back
#define all(v) v.begin(),v.end()
const ll M=2e5+10;
bool vis[M];
void Anna( int n, long long x, int k, int pos[] ){
for(int i=0;i<k;i++){
vis[pos[i]]=1;
}
ll cnt=0;
for(int i=0;i<n;i++){
if(cnt>60){
Set(i,0);
continue;
}
if(i<n-1&&!vis[i]&&!vis[i+1]){
Set(i,1);
if((x&(1ll<<cnt))>0ll)
Set(i+1,1);
else
Set(i+1,0);
i++;
cnt++;
continue;
}
else{
Set(i,0);
}
}
}
#include "Brunolib.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vii;
typedef pair<ll,ll> pii;
#define F first
#define S second
#define pb push_back
#define all(v) v.begin(),v.end()
long long Bruno(int n,int a[]){
ll ans=0,cnt=0;
for(int i=0;i<n;i++){
if(a[i]==1){
if(a[i+1]==1){
ans|=(1ll<<cnt);
cnt++;
}
else{
cnt++;
}
i++;
}
}
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |