QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#796131#7619. Make SYSU Great Again IMaxduan#WA 1ms3716kbC++23901b2024-12-01 12:47:362024-12-01 12:47:37

Judging History

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

  • [2024-12-01 12:47:37]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3716kb
  • [2024-12-01 12:47:36]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define int long long
#define pii pair<int,int>

const int N = 2e5 + 5;

int n,k;
pair<int,int> pos[N];

void solve(){
    cin>>n>>k;
    int now=1;
    for(int i=1;i<=n;i++){
        pos[now++]={i,i};
        if(i!=n)
            pos[now++]={i,i+1};
        else
            pos[now++]={i,i-1};
    }
    if(now<=k){
        for(int i=1;i<=n&&now<=k;i++){
            for(int j=1;j<=n&&now<=k;j++){
                if(j==i||j==i+1||(i==n&&j==n-1))
                    continue;
                pos[now++]={i,j};
            }
        }
    }
    for(int i=1;i<=k;i++){
        cout<<pos[i].first<<' '<<pos[i].second<<endl;
    }
    return;
}

signed main(){
    ios::sync_with_stdio(0);
    cin.tie(0);cout.tie(0);
    int T=1;//cin>>T;
    while(T--){
        solve();
    }
    return 0;
}

详细

Test #1:

score: 0
Wrong Answer
time: 1ms
memory: 3716kb

input:

3 6

output:

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

result:

wrong answer The answer is wrong: There are fewer than two numbers in one row or column