QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#356478#7619. Make SYSU Great Again I11d10xyWA 0ms3836kbC++17401b2024-03-17 20:55:002024-03-17 20:55:01

Judging History

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

  • [2024-03-17 20:55:01]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3836kb
  • [2024-03-17 20:55:00]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
int n,k;
pair<int,int>ans[200010];
int main(){
   cin>>n>>k;
   for(int i=1;i<=n;i++)ans[i*2-1]={i,i};
   for(int i=1;i<n;i++)ans[i*2]={i,i+1};
   ans[n*2]={n,1};
   for(int i=n*2+1,x=1,y=1;i<=k;y++,y>n&&(y=1,x++))
   if(y!=x+1&&!(x==n&&y==1))ans[i++]={x,y};
   for(int i=1;i<=k;i++)printf("%d %d\n",ans[i].first,ans[i].second);
   return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

3 6

output:

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

result:

ok The answer is correct.

Test #2:

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

input:

3 7

output:

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

result:

wrong answer The answer is wrong: Multiple numbers filled in a grid.