QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#248469#7619. Make SYSU Great Again Iucup-team093#WA 0ms3596kbC++141.1kb2023-11-11 19:21:452023-11-11 19:21:46

Judging History

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

  • [2023-11-11 19:21:46]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3596kb
  • [2023-11-11 19:21:45]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);

    int n, k;
    cin >> n >> k;
    
    using pii = pair<int, int>;
    vector<pii> ans;
    if(n & 1) {
        ans = {pii{1, 1}, pii{2, 2}, pii{2, 3}, pii{1, 3}, pii{3, 2}, pii{3, 1}};
        for(int i = 4; i <= n; i += 2) {
            ans.emplace_back(i, i + 1);
            ans.emplace_back(i, i);
            ans.emplace_back(i + 1, i + 1);
            ans.emplace_back(i + 1, i);
        }
    }else{
        for(int i = 1; i <= n; i += 2) {
            ans.emplace_back(i, i + 1);
            ans.emplace_back(i, i);
            ans.emplace_back(i + 1, i + 1);
            ans.emplace_back(i + 1, i);
        }
    }

    vector<pii> v(ans);
    sort(v.begin(), v.end());

    for(int i = 1; i <= n && ans.size() < k; i ++)
        for(int j = 1; j <= n && ans.size() < k; j ++)
            if(!binary_search(v.begin(), v.end(), pii{i, j}))
                ans.emplace_back(i, j);
    
    for(auto [x, y] : ans)
        cout << x << " " << y << "\n";
            
}

详细

Test #1:

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

input:

3 6

output:

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

result:

ok The answer is correct.

Test #2:

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

input:

3 7

output:

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

result:

ok The answer is correct.

Test #3:

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

input:

2 4

output:

1 2
1 1
2 2
2 1

result:

wrong answer The answer is wrong: The maximum common divisor of row 1 and column 351208576 is not the same.