QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#484842 | #8651. Table Tennis | Qwerty1232# | 0 | 7ms | 3876kb | C++23 | 1.9kb | 2024-07-20 03:02:08 | 2024-07-20 03:02:08 |
answer
#include <bits/stdc++.h>
int count(int n, const std::vector<std::vector<bool>> &data) {
int cnt = 0;
for (int i = 0; i < n; i++) {
for (int j = i + 1; j < n; j++) {
for (int k = j + 1; k < n; k++) {
if (data[i][j] == data[j][k] && data[j][k] == data[k][i]) {
cnt++;
}
}
}
}
return cnt;
}
std::mt19937 rnd;
void solve() {
int n, m;
std::cin >> n >> m;
std::vector<std::vector<bool>> ans(n, std::vector<bool>(n));
// clock_t beg = clock();
if (m <= n - 2) {
for (int i = 0; i < n; i++) {
for (int j = i + 1; j < n; j++) {
ans[i][j] = (i == 0 && j == m);
ans[j][i] = !ans[i][j];
}
}
std::cout << "Yes\n";
for (int i = 0; i < n; i++) {
for (int j = 0; j < i; j++) {
std::cout << ans[i][j] << " \n"[j == i - 1];
}
}
return;
}
// for (int t = 0; t < 1e5 * n * n * n; t++) {
// for (int i = 0; i < n; i++) {
// for (int j = i + 1; j < n; j++) {
// int b = rnd() % int(1e9 + 7) % 2;
// ans[i][j] = b;
// ans[j][i] = !b;
// }
// }
// int cnt = count(n, ans);
// if (cnt == m) {
// std::cout << "Yes\n";
// for (int i = 0; i < n; i++) {
// for (int j = 0; j < i; j++) {
// std::cout << ans[i][j] << " \n"[j == i - 1];
// }
// }
// return;
// }
// }
std::cout << "No\n";
}
int32_t main() {
std::ios_base::sync_with_stdio(false);
std::cin.tie(nullptr);
int t;
std::cin >> t;
while (t--) {
solve();
}
return 0;
}
详细
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 0
Wrong Answer
time: 7ms
memory: 3608kb
input:
97 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 0 11 0 12 0 13 0 14 0 15 0 16 0 17 0 18 0 19 0 20 0 21 0 22 0 23 0 24 0 25 0 26 0 27 0 28 0 29 0 30 0 31 0 32 0 33 0 34 0 35 0 36 0 37 0 38 0 39 0 40 0 41 0 42 0 43 0 44 0 45 0 46 0 47 0 48 0 49 0 50 0 51 0 52 0 53 0 54 0 55 0 56 0 57 0 58 0 59 0 60 0 61 0 62 0 63 0...
output:
Yes 1 1 1 Yes 1 1 1 1 1 1 Yes 1 1 1 1 1 1 1 1 1 1 Yes 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Yes 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Yes 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Yes 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Yes 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...
result:
wrong answer The string on the 2-th line should contain exactly 2 characters (test case 1)
Subtask #2:
score: 0
Wrong Answer
Test #58:
score: 4
Accepted
time: 0ms
memory: 3812kb
input:
1 4 4
output:
No
result:
ok good job! (1 test case)
Test #59:
score: 0
Accepted
time: 0ms
memory: 3652kb
input:
1 5 10
output:
No
result:
ok good job! (1 test case)
Test #60:
score: 0
Accepted
time: 0ms
memory: 3844kb
input:
1 6 20
output:
No
result:
ok good job! (1 test case)
Test #61:
score: 0
Accepted
time: 0ms
memory: 3616kb
input:
1 7 35
output:
No
result:
ok good job! (1 test case)
Test #62:
score: 0
Accepted
time: 0ms
memory: 3644kb
input:
1 5 10
output:
No
result:
ok good job! (1 test case)
Test #63:
score: 0
Accepted
time: 0ms
memory: 3644kb
input:
1 6 19
output:
No
result:
ok good job! (1 test case)
Test #64:
score: 0
Accepted
time: 0ms
memory: 3844kb
input:
1 6 20
output:
No
result:
ok good job! (1 test case)
Test #65:
score: 0
Accepted
time: 0ms
memory: 3612kb
input:
1 7 33
output:
No
result:
ok good job! (1 test case)
Test #66:
score: 0
Accepted
time: 0ms
memory: 3844kb
input:
1 7 33
output:
No
result:
ok good job! (1 test case)
Test #67:
score: 0
Accepted
time: 0ms
memory: 3612kb
input:
1 4 3
output:
No
result:
ok good job! (1 test case)
Test #68:
score: 0
Accepted
time: 0ms
memory: 3680kb
input:
1 5 8
output:
No
result:
ok good job! (1 test case)
Test #69:
score: 0
Accepted
time: 0ms
memory: 3876kb
input:
1 6 17
output:
No
result:
ok good job! (1 test case)
Test #70:
score: 0
Accepted
time: 0ms
memory: 3584kb
input:
1 7 30
output:
No
result:
ok good job! (1 test case)
Test #71:
score: -4
Wrong Answer
time: 0ms
memory: 3588kb
input:
2 3 0 3 1
output:
Yes 1 1 1 Yes 0 1 1
result:
wrong answer The string on the 2-th line should contain exactly 2 characters (test case 1)
Subtask #3:
score: 0
Skipped
Dependency #2:
0%
Subtask #4:
score: 0
Skipped
Dependency #3:
0%
Subtask #5:
score: 0
Skipped
Dependency #4:
0%
Subtask #6:
score: 0
Skipped
Dependency #1:
0%