Submission #642738

#TimeUsernameProblemLanguageResultExecution timeMemory
642738qwerasdfzxclBroken Device 2 (JOI22_device2)C++17
80 / 100
84 ms3656 KiB
#include "Anna.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; namespace { } int Declare() { return 178; } std::pair<std::vector<int>, std::vector<int> > Anna(long long A) { vector<int> ret[2]; for (int i=0;i<60;i++){ if (A&(1LL<<i)) for (int j=0;j<(i==59?1:3);j++) ret[0].push_back(1); else for (int j=0;j<(i==59?1:3);j++) ret[0].push_back(0); } for (int i=0;i<178;i++) ret[1].push_back(!(i&1)); return {ret[0], ret[1]}; }
#include "Bruno.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; namespace { } long long Bruno(std::vector<int> U) { ll ans = 0; int i = 0, pt = 0, cur = 0, val = 0; for (;i<59;i++){ while(pt<(int)U.size()){ cur += U[pt]?1:-1; ++pt; if (cur==val+3 || cur==val-2) break; } assert(cur==val+3 || cur==val-2); if (cur==val+3) ans |= (1LL<<i), val += 3; else val -= 3; } while(pt<(int)U.size()){ cur += U[pt]?1:-1; ++pt; } assert(cur==val+1 || cur==val-1); if (cur==val+1) ans |= (1LL<<59); return ans; }
#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...