QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#810975#9799. Magical Paletterotcar07WA 1ms3620kbC++23359b2024-12-12 14:08:312024-12-12 14:08:37

Judging History

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

  • [2024-12-12 14:08:37]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3620kb
  • [2024-12-12 14:08:31]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;

inline void solve(){
	int n,m;cin>>n>>m;
	if(gcd(n,m)!=1)return cout<<"NO\n",void();
	cout<<"YES\n";
	if(n==1&&m==1) cout<<"0\n0\n";
	else{
		for(int i=0;i<n;i++)cout<<i*m+1<<' ';cout<<'\n';
		for(int i=0;i<m;i++)cout<<i*n+1<<' ';cout<<'\n';
	} 
}
int main(){
	int T;cin>>T;
	while(T--) solve();
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

2
2 3
2 2

output:

YES
1 4 
1 3 5 
NO

result:

wrong answer Token parameter [name=verdict] equals to "YES", doesn't correspond to pattern "Yes|No" (test case 1)