이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "Anna.h"
#include <bits/stdc++.h>
using namespace std;
int Declare() {
return 180;
}
pair<vector<int>, vector<int> > Anna(long long x) {
vector<int> a, b;
int alt = 1;
int last = 1;
for (int i = 0; i < 60; i++) {
int c = x >> i & 1;
int num = c == last ? 2 : 3;
last = c;
while (num--) {
a.push_back(c);
b.push_back(alt);
alt ^= 1;
}
}
return make_pair(a, b);
}
#include "Bruno.h"
#include <bits/stdc++.h>
using namespace std;
long long Bruno(vector<int> u) {
long long x = 0;
int sum = 0;
int mag = 0;
for (int b : u) {
sum += b == 0 ? -1 : +1;
if (sum == -2) {
x += 0LL << mag;
mag++;
sum = 0;
}
if (sum == +2) {
x += 1LL << mag;
mag++;
sum = 0;
}
}
return x;
}
# | 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... |