QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#762134#7619. Make SYSU Great Again Iguodong#WA 0ms3584kbC++17655b2024-11-19 13:52:292024-11-19 13:52:38

Judging History

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

  • [2024-11-19 13:52:38]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3584kb
  • [2024-11-19 13:52:29]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
map<pair<int,int>,int>a;
int main(){
    int n,k;
    cin>>n>>k;
    for(int i=1; i<=n*2-1; i++){
        if(i%2==1)a[make_pair((i+1)/2,(i+1)/2)]=i,cout<<(i+1)/2<<' '<<(i+1)/2<<endl;
        else a[make_pair(i/2,i/2+1)]=i,cout<<i/2<<' '<<i/2+1<<endl;
    }
    a[make_pair(n,n-1)]=n*2;
    cout<<n<<' '<<n-1<<endl;
    int x=1,y=1;
    for(int i=n*2+1; i<=k; i++){
        while(a.find(make_pair(x,y))!=a.end()){
            y++;
            if(y>n){
                x++;
                y=1;
            }
        }
        a[make_pair(x,y)]=i;
        cout<<x<<' '<<y<<endl;
    }

}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

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