# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
565295 | Sorting | Broken Device 2 (JOI22_device2) | C++17 | 103 ms | 3644 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 "Anna.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
static const int BITS = 60;
int Declare() {
return 3 * BITS;
}
pair<vector<int>, vector<int>> Anna(ll a) {
vector<int> v1, v2;
for(int i = 0; i < 3 * BITS; i += 2){
v1.push_back(0);
v1.push_back(1);
}
for(int i = 0; i < BITS; ++i){
int bit = (a >> i) & 1;
v2.push_back(bit);
v2.push_back(bit);
v2.push_back(bit);
}
return {v1, v2};
}
#include "Bruno.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
static const int BITS = 60;
ll Bruno(vector<int> u) {
int curr = 0, prefix = 0;
vector<int> bits;
for(int i = 0; i < u.size(); ++i){
prefix += u[i] ? 1 : -1;
if(prefix <= curr - 3){
bits.push_back(0);
curr -= 3;
}
else if(prefix >= curr + 2){
bits.push_back(1);
curr += 3;
}
}
ll ans = 0;
for(ll i = 0; i < bits.size(); ++i)
ans += bits[i] << i;
return ans;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |