Submission #852137

#TimeUsernameProblemLanguageResultExecution timeMemory
852137Rafi22Broken Device (JOI17_broken_device)C++14
0 / 100
32 ms2716 KiB
#include <bits/stdc++.h> #include "Annalib.h" #define ll long long #define ld long double #define endl '\n' #define st first #define nd second #define pb push_back #define sz(x) (int)(x).size() #define all(x) (x).begin(), (x).end() using namespace std; //int inf=1000000007; //int mod=1000000007; //int mod1=998244353; bool bad[157]; int res[157]; void Anna(int n,ll x,int k,int P[]) { for(int i=0;i<150;i++) { bad[i]=0; res[i]=0; } for(int i=0;i<k;i++) bad[P[i]]=1; srand(2137); vector<int>X; for(int i=59;i>=0;i--) { if(i<=29) X.pb(i); X.pb(i); X.pb(i); } random_shuffle(all(X)); for(int i=59;i>=0;i--) { for(int j=0;j<150;j++) { if(X[j]==i&&!bad[j]&&x>=(1LL<<i)) { res[j]=1; x-=(1LL<<i); } } } if(x!=0) cout<<"XDDDDDD"<<endl; for(int i=0;i<150;i++) Set(i,res[i]); }
#include <bits/stdc++.h> #include "Brunolib.h" #define ll long long #define ld long double #define endl '\n' #define st first #define nd second #define pb push_back #define sz(x) (int)(x).size() #define all(x) (x).begin(), (x).end() using namespace std; //int inf=1000000007; //int mod=1000000007; //int mod1=998244353; ll Bruno(int n,int a[]) { srand(2137); vector<int>X; for(int i=59;i>=0;i--) { if(i<=29) X.pb(i); X.pb(i); X.pb(i); } random_shuffle(all(X)); ll wyn=0; for(int i=0;i<150;i++) { if(a[i]==1) wyn+=(1LL<<X[i]); } return wyn; }
#Verdict Execution timeMemoryGrader output
Fetching results...