QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#252020#7619. Make SYSU Great Again Iucup-team045#WA 0ms3772kbC++201.5kb2023-11-15 14:41:222023-11-15 14:41:22

Judging History

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

  • [2023-11-15 14:41:22]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3772kb
  • [2023-11-15 14:41:22]
  • 提交

answer

#include<iostream>
#include<cstring>
#include<vector>
#include<set> 
#include<numeric>
#include<algorithm>
#include<cassert>
#include<set>
using namespace std;
using LL = long long;

int main(){

#ifdef LOCAL
    freopen("data.in", "r", stdin);
    freopen("data.out", "w", stdout);
#endif

    cin.tie(0);
    cout.tie(0);
    ios::sync_with_stdio(0);

    int n, k;
    cin >> n >> k;
    vector<pair<int, int> > ans(k + 1);
    int st = 1, cur = 0;
    if (n % 3 == 1){
        st = 5;
        cur = 8;
        ans[1] = {1, 1};
        ans[2] = {1, 2};
        ans[3] = {2, 2};
        ans[4] = {2, 1};
        ans[5] = {3, 3};
        ans[6] = {3, 4};
        ans[7] = {4, 4};
        ans[8] = {4, 3};
    }
    else if (n % 3 == 2){
        st = 3;
        cur = 4;
        ans[1] = {1, 1};
        ans[2] = {1, 2};
        ans[3] = {2, 2};
        ans[4] = {2, 1};
    }
    for(int i = st; i <= n; i += 3){
        int l = i;
        ans[++cur] = {l, l + 2};
        ans[++cur] = {l + 1, l + 2};
        ans[++cur] = {l, l};
        ans[++cur] = {l + 1, l + 1};
        ans[++cur] = {l + 2, l};
        ans[++cur] = {l + 2, l + 1};
    }
    set<pair<int, int> > s(ans.begin(), ans.end());
    for(int i = 1; i <= n && cur < k; i++){
        for(int j = 1; j <= n && cur < k; j++){
            if (!s.contains({i, j})){
                ans[++cur] = {i, j};
            }
        }
    }
    for(int i = 1; i <= k; i++){
        cout << ans[i].first << ' ' << ans[i].second << '\n';
    }

}

详细

Test #1:

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

input:

3 6

output:

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

result:

ok The answer is correct.

Test #2:

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

input:

3 7

output:

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

result:

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