QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#168969 | #6661. 야유회 | Cyanmond | 0 | 0ms | 0kb | C++17 | 1.5kb | 2023-09-09 08:56:14 | 2023-09-09 08:56:14 |
answer
#include "workshop.h"
#include <bits/stdc++.h>
constexpr int M = 40;
std::array<int, M> P;
void init() {
std::mt19937 mt(10);
std::iota(P.begin(), P.end(), 0);
std::shuffle(P.begin(), P.end(), mt);
}
int morning(int my_num, int right_num) {
std::uniform_int_distribution<int> dist(0, M - 1);
const auto x = P[my_num % M], y = P[right_num % M];
if (x != y) return x;
else {
std::mt19937 mt(0);
int ret = -1;
while (true) {
const auto u = dist(mt);
if (u != y) {
ret = u;
break;
}
}
return ret;
}
}
int afternoon(int left_num, int my_num, int right_num) {
std::uniform_int_distribution<int> dist(0, M - 1);
std::mt19937 mt(my_num + right_num + left_num);
int ret = -1;
if (my_num != right_num) return my_num;
while (true) {
const auto u = dist(mt);
if (u != left_num and u != right_num) {
ret = u;
break;
}
}
return ret;
}
int evening(int left_num, int my_num, int right_num) {
std::uniform_int_distribution<int> dist(0, M - 1);
std::mt19937 mt(my_num + left_num + right_num);
int ret = -1;
if (my_num != right_num) return my_num;
while (true) {
const auto u = dist(mt);
if (u != left_num and u != right_num) {
ret = u;
break;
}
}
return ret;
}
詳細信息
Subtask #1:
score: 0
Dangerous Syscalls
Test #1:
score: 0
Dangerous Syscalls
input:
2dc2b1d4-8de2-INPUT-bcd3-aa55b691fdb3 1 2 40 40 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 40 0 3 1 5 7 9 6 4 2 10 8 23 21 25 27 29 26 24 22 30 28 13 11 15 17 19 16 14 12 20 18 33 31 35 37 39 36 34 32 38
output:
dd180566-1d37-PIPE-b85d-c176ae85727d 40 2 28 28 28 28 89 88 8b 8a 8d 8c 8f 8e 81 80 83 82 85 84 87 86 99 98 9b 9a 9d 9c 9f 9e 91 90 93 92 95 94 97 96 a9 a8 ab aa ad ac af ae 0000009f 00000094 00000089 000000ad 00000092 000000af 0000008a 00000096 000000aa 000000ab 000000ac 0000009b 00000087 0000009e...
input:
dd180566-1d37-PIPE-b85d-c176ae85727d 40 2 28 28 28 28 89 88 8b 8a 8d 8c 8f 8e 81 80 83 82 85 84 87 86 99 98 9b 9a 9d 9c 9f 9e 91 90 93 92 95 94 97 96 a9 a8 ab aa ad ac af ae 0000009f 00000094 00000089 000000ad 00000092 000000af 0000008a 00000096 000000aa 000000ab 000000ac 0000009b 00000087 0000009e...
output:
4468cc07-dabe-OUTPUT-ba95-7ddd49645c94 40
result:
Subtask #2:
score: 0
Dangerous Syscalls
Test #8:
score: 0
Dangerous Syscalls
input:
2dc2b1d4-8de2-INPUT-bcd3-aa55b691fdb3 2 2 40 40 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 40 0 3 1 5 7 9 6 4 2 10 8 23 21 25 27 29 26 24 22 30 28 13 11 15 17 19 16 14 12 20 18 33 31 35 37 39 36 34 32 38
output:
dd180566-1d37-PIPE-b85d-c176ae85727d 40 2 28 28 28 28 89 88 8b 8a 8d 8c 8f 8e 81 80 83 82 85 84 87 86 99 98 9b 9a 9d 9c 9f 9e 91 90 93 92 95 94 97 96 a9 a8 ab aa ad ac af ae 0000009f 00000094 00000089 000000ad 00000092 000000af 0000008a 00000096 000000aa 000000ab 000000ac 0000009b 00000087 0000009e...
input:
dd180566-1d37-PIPE-b85d-c176ae85727d 40 2 28 28 28 28 89 88 8b 8a 8d 8c 8f 8e 81 80 83 82 85 84 87 86 99 98 9b 9a 9d 9c 9f 9e 91 90 93 92 95 94 97 96 a9 a8 ab aa ad ac af ae 0000009f 00000094 00000089 000000ad 00000092 000000af 0000008a 00000096 000000aa 000000ab 000000ac 0000009b 00000087 0000009e...
output:
4468cc07-dabe-OUTPUT-ba95-7ddd49645c94 40