QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#656814#7619. Make SYSU Great Again IDarksideCoderWA 1ms3960kbC++20431b2024-10-19 13:43:542024-10-19 13:44:00

Judging History

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

  • [2024-10-19 13:44:00]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3960kb
  • [2024-10-19 13:43:54]
  • 提交

answer

#include<bits/stdc++.h>

std::map<std::pair<int,int>,bool>M;
int n,k;
int main(){
	scanf("%d%d",&n,&k);
	int x=1,y=1;
	for(int i=1;i<n*2;i++){
		printf("%d %d\n",x,y);
		M[{x,y}]=true;
		if(i%2==1)y++;
		else x++;
	}
	printf("%d %d\n",n,1);
	M[{1,n}]=true;
	x=1,y=1;
	for(int i=2*n+1;i<=k;i++){
		while(M.find({x,y})!=M.end()){
			y++;
			if(y==n+1){x++,y=1;}
		}
		printf("%d %d\n",x,y);
	}
	
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

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: 0
Accepted
time: 0ms
memory: 3912kb

input:

3 7

output:

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

result:

ok The answer is correct.

Test #3:

score: 0
Accepted
time: 0ms
memory: 3780kb

input:

2 4

output:

1 1
1 2
2 2
2 1

result:

ok The answer is correct.

Test #4:

score: -100
Wrong Answer
time: 1ms
memory: 3960kb

input:

3 9

output:

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

result:

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