# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
55112 | ksun48 | Broken Device (JOI17_broken_device) | C++14 | 77 ms | 4096 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 "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(48222);
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
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |