QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#247060 | #7619. Make SYSU Great Again I | ucup-team1069# | WA | 9ms | 52316kb | C++20 | 931b | 2023-11-11 13:18:52 | 2023-11-11 13:18:52 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
typedef long long ll;
const int N = 1e6 + 200;
int n, k;
pair<int, int> pos[N];
map<int, int> used[N];
int main() {
ios_base::sync_with_stdio(0), cin.tie(0);
cin >> n >> k;
pos[1] = {n, 1};
for (int i = 2; i <= n + n; ++i) {
if (i % 2 == 0) {
pos[i] = {i / 2, i / 2};
used[i / 2][i / 2] = 1;
}
else {
pos[i] = {i / 2, i / 2 + 1};
used[i / 2][i / 2 + 1] = 1;
}
}
int now = 2 * n + 1;
for (int i = 1; i <= n; ++i) {
for (int j = 1; j <= n; ++j) {
if (now > k) break;
if (used[i].count(j) == 0)
pos[now++] = {i, j};
}
if (now > k) break;
}
for (int i = 1; i <= k; ++i)
cout << pos[i].F << " " << pos[i].S << '\n';
}
詳細信息
Test #1:
score: 100
Accepted
time: 9ms
memory: 52316kb
input:
3 6
output:
3 1 1 1 1 2 2 2 2 3 3 3
result:
ok The answer is correct.
Test #2:
score: 0
Accepted
time: 4ms
memory: 51668kb
input:
3 7
output:
3 1 1 1 1 2 2 2 2 3 3 3 1 3
result:
ok The answer is correct.
Test #3:
score: 0
Accepted
time: 8ms
memory: 51632kb
input:
2 4
output:
2 1 1 1 1 2 2 2
result:
ok The answer is correct.
Test #4:
score: -100
Wrong Answer
time: 3ms
memory: 52168kb
input:
3 9
output:
3 1 1 1 1 2 2 2 2 3 3 3 1 3 2 1 3 1
result:
wrong answer The answer is wrong: Multiple numbers filled in a grid.