Submission #959085

#TimeUsernameProblemLanguageResultExecution timeMemory
959085De3b0oBroken Device (JOI17_broken_device)C++14
41 / 100
50 ms2932 KiB
#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 timeMemoryGrader output
Fetching results...