QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#248463#7619. Make SYSU Great Again Iucup-team093#WA 0ms3616kbC++141.1kb2023-11-11 19:17:392023-11-11 19:17:40

Judging History

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

  • [2023-11-11 19:17:40]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3616kb
  • [2023-11-11 19:17:39]
  • 提交

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{1, 3}, pii{2, 3}, pii{3, 1}, pii{3, 2}};
        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";
            
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

3 6

output:

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

result:

ok The answer is correct.

Test #2:

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

input:

3 7

output:

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

result:

wrong answer The answer is wrong: The maximum common divisor of row 2 and column -1427700608 is not the same.