QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#504843 | #6661. 야유회 | bykem | 0 | 2ms | 3960kb | C++20 | 970b | 2024-08-04 16:40:28 | 2024-08-04 16:40:29 |
answer
#include <string>
using namespace std;
constexpr int kN = 21;
int c[kN][kN];
void init() {
c[0][0] = 1;
for (int i = 1; i < kN; ++i) {
c[i][0] = 1;
for (int j = 1; j < kN; ++j) {
c[i][j] = c[i - 1][j] + c[i - 1][j - 1];
}
}
}
string g(int x, int k) {
string s;
for (int i = 0, j = 0; i < 2 * k; ++i) {
if (x >= c[2 * k - i - 1][k - j]) {
x -= c[2 * k - i - 1][k - j], ++j;
s += '1';
} else {
s += '0';
}
}
return s;
}
int f(int x, int y, int k) {
string sx = g(x, k), sy = g(y, k);
for (int i = 0; i < 2 * k; ++i) {
if (sx[i] == '0' && sy[i] == '1') {
return i;
}
}
return -1;
}
int morning(int x, int r) {
return f(x, r, 10);
}
int afternoon(int l, int x, int r) {
int p = f(l, x, 6), q = f(x, r, 6);
return f(p, q, 4);
}
int evening(int l, int x, int r) {
return x < 3 ? x : (l == 0 || r == 0 ? 1 + (l == 1 || r == 1) : 0);
}
详细
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 0
Wrong Answer
time: 2ms = 1ms + 1ms
memory: 3960kb,3856kb
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:
64be09ab-d709-ERROR-82bc-c23f6124dd26 Wrong Answer [4]
input:
64be09ab-d709-ERROR-82bc-c23f6124dd26 Wrong Answer [4]
output:
64be09ab-d709-ERROR-82bc-c23f6124dd26 Wrong Answer [4]
result:
wrong answer Wrong Answer [4]
Subtask #2:
score: 0
Wrong Answer
Test #8:
score: 0
Wrong Answer
time: 1ms = 0ms + 1ms
memory: 3680kb,3852kb
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:
64be09ab-d709-ERROR-82bc-c23f6124dd26 Wrong Answer [4]
input:
64be09ab-d709-ERROR-82bc-c23f6124dd26 Wrong Answer [4]
output:
64be09ab-d709-ERROR-82bc-c23f6124dd26 Wrong Answer [4]
result:
wrong answer Wrong Answer [4]