QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#266779#7619. Make SYSU Great Again IMarch_April#WA 0ms3752kbC++20801b2023-11-26 17:35:002023-11-26 17:35:00

Judging History

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

  • [2023-11-26 17:35:00]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3752kb
  • [2023-11-26 17:35:00]
  • 提交

answer

#include <bits/stdc++.h>

using namespace std;

int main()
{
    int n, k;
    cin >> n >> k;

    vector<pair<int, int>> res;
    
    int j = 0;
    vector<vector<int>> st(n + 1, vector<int> (n + 1));
    for(int i = 1;i <= n; i ++)
    {
        res.push_back({i, i});
        if(i != n)
        res.push_back({i, i + 1});
        else    
            res.push_back({i, 1});
        st[i][i] = st[i][i + 1] = true;
    }

    vector<pair<int, int>> nop;
    for(int i = 1;i <= n; i ++)
        for(int j = 1;j <= n; j ++)
            if(!st[i][j])   nop.push_back({i, j});
    

    while(res.size() < k)
    {
        res.push_back(nop.back());
        nop.pop_back();
    }

    for(auto [x, y] : res)
        cout << x << ' ' << y << '\n';
    return 0;

}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3584kb

input:

3 6

output:

1 1
1 2
2 2
2 3
3 3
3 1

result:

ok The answer is correct.

Test #2:

score: 0
Accepted
time: 0ms
memory: 3588kb

input:

3 7

output:

1 1
1 2
2 2
2 3
3 3
3 1
3 2

result:

ok The answer is correct.

Test #3:

score: 0
Accepted
time: 0ms
memory: 3464kb

input:

2 4

output:

1 1
1 2
2 2
2 1

result:

ok The answer is correct.

Test #4:

score: -100
Wrong Answer
time: 0ms
memory: 3752kb

input:

3 9

output:

1 1
1 2
2 2
2 3
3 3
3 1
3 2
3 1
2 1

result:

wrong answer The answer is wrong: Multiple numbers filled in a grid.