Submission #1024070

#TimeUsernameProblemLanguageResultExecution timeMemory
1024070UnforgettableplBroken Device 2 (JOI22_device2)C++17
80 / 100
66 ms4116 KiB
#include "Anna.h" #include <bits/stdc++.h> using namespace std; const int BITS = 60; const int M = BITS*3 + 1; namespace { } int Declare() {return M;} pair<vector<int>, vector<int>> Anna(long long A) { vector<int> ans,b(M); for(int i=0;i<M;i+=2)b[i]=1; if(A&1){ ans.emplace_back(1); ans.emplace_back(1); } else { ans.emplace_back(0); ans.emplace_back(0); ans.emplace_back(0); ans.emplace_back(0); } for(int bit=1;bit<BITS;bit++){ int a = min(A&(1ll<<bit),1ll); ans.emplace_back(a); ans.emplace_back(a); ans.emplace_back(a); } b.resize(ans.size()); return {ans,b}; }
#include "Bruno.h" #include <bits/stdc++.h> using namespace std; const int BITS = 60; const int M = BITS*3 + 1; namespace { } long long Bruno(vector<int> u) { // assert(u.size()==2*M); for(int&x:u)if(x==0)x=-1; vector<int> ans; int sum = 0; int lastsum = 0; for(int&x:u){ sum+=x; if(((sum%3)+3)%3 == 1)continue; if(sum<lastsum-1){ ans.emplace_back(0); lastsum = sum; } else if(sum>lastsum+1){ ans.emplace_back(1); lastsum = sum; } } assert(ans.size()==BITS); long long res = 0; for(int bit=0;bit<BITS;bit++)if(ans[bit])res|=(1ll<<bit); return res; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...