# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
55042 | ksun48 | Broken Device (JOI17_broken_device) | C++14 | 152 ms | 3968 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "Annalib.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
void done(vector<LL> message, vector<LL> perm){
for(int i = 0; i < message.size(); i++){
Set(i, message[perm[i]]);
}
}
void Anna(int N, long long X, int K, int P[]){
// shared initialization
static mt19937_64 mt1(4848);
static mt19937_64 mt2(484848);
static LL B = 60;
LL Y = mt1() & ((1LL << B) - 1);
vector<LL> perm(N);
for(int i = 0; i < N; i++){
perm[i] = i;
}
for(int i = N-1; i >= 0; i--){
int d = mt2() % (i+1);
if(d < 0){
d += (i+1);
}
swap(perm[i], perm[d]);
}
// shared initialization
vector<LL> info(60);
for(LL i = 0; i < 60; i++){
info[i] = ((X ^ Y) >> i) & 1;
}
vector<LL> message(N, 0);
// boilerplate
// ----------------------------------
for(int i = 0; i < N; i++){
message[i] = info[i % 60];
}
// ----------------------------------
done(message, perm);
}
#include "Brunolib.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
using namespace std;
LL done(vector<LL> info, LL b){
LL a = 0;
for(LL i = 0; i < 60; i++){
a ^= info[i] << i;
}
return a ^ b;
}
long long Bruno(int N, int A[]){
// shared initialization
static mt19937_64 mt1(4848);
static mt19937_64 mt2(484848);
static LL B = 60;
LL Y = mt1() & ((1LL << B) - 1);
vector<LL> perm(N);
for(int i = 0; i < N; i++){
perm[i] = i;
}
for(int i = N-1; i >= 0; i--){
int d = mt2() % (i+1);
if(d < 0){
d += (i+1);
}
swap(perm[i], perm[d]);
}
// shared initialization
vector<LL> message(N);
for(int i = 0; i < N; i++){
message[perm[i]] = A[i];
}
vector<LL> info(60, 0);
// boilerplate
// ----------------------------------
for(int i = 0; i < N; i++){
info[i % 60] = max(info[i % 60], message[i]);
}
// ----------------------------------
return done(info, Y);
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |