# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
546211 | blue | Broken Device 2 (JOI22_device2) | C++17 | 584 ms | 4560 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "Anna.h"
#include <utility>
#include <vector>
#include <iostream>
using namespace std;
namespace {
int variable_example = 0;
using ll = long long;
const int bits = 60;
const int bs = 3;
}
int Declare() {
return bs * bits;
}
std::pair<std::vector<int>, std::vector<int> > Anna(long long A) {
vector<int> S, T;
for(int i = 0; i < bits*bs/2; i++)
{
S.push_back(0);
S.push_back(1);
}
ll pow2[bits];
pow2[0] = 1;
for(int e = 1; e < bits; e++)
pow2[e] = 2LL * pow2[e-1];
for(int i = 0; i < bits; i++)
{
for(int j = 0; j < bs; j++)
{
T.push_back(bool(A & pow2[i]));
}
}
for(int i = 0; i < bits*bs; i++) cerr << S[i];
cerr << '\n';
for(int i = 0; i < bits*bs; i++) cerr << T[i];
cerr << '\n';
return make_pair(S, T);
}
#include "Bruno.h"
#include <utility>
#include <vector>
#include <iostream>
using namespace std;
namespace {
int variable_example = 0;
using vi = vector<int>;
using ll = long long;
const int bits = 60;
const int bs = 3;
}
long long Bruno(vi u) {
int sm = 0;
ll res = 0;
ll cp = 1;
// cerr << "u = ";
// for(int k:u) cerr << k;
// cerr << '\n';
for(int i = 0; i < 2 * bits*bs; i++)
{
if(u[i] == 0) sm++;
else sm--;
// cerr << i << " : " << sm << '\n';
if(sm == bs)
{
cp *= 2;
sm -= bs;
// cerr << "+ detected\n";
}
else if(sm == -bs + 1)
{
res += cp;
// cerr << "adding " << cp << '\n';
cp *= 2;
sm += bs;
// cerr << "- detected\n";
}
}
// cerr << "returning " << res << '\n';
return res;
}
컴파일 시 표준 에러 (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... |