QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#247060#7619. Make SYSU Great Again Iucup-team1069#WA 9ms52316kbC++20931b2023-11-11 13:18:522023-11-11 13:18:52

Judging History

你现在查看的是最新测评结果

  • [2023-11-11 13:18:52]
  • 评测
  • 测评结果:WA
  • 用时:9ms
  • 内存:52316kb
  • [2023-11-11 13:18:52]
  • 提交

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.