QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#866126#9799. Magical PaletteNana7WA 1ms3584kbC++14483b2025-01-22 12:37:592025-01-22 12:37:59

Judging History

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

  • [2025-01-22 12:37:59]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3584kb
  • [2025-01-22 12:37:59]
  • 提交

answer

#include<iostream>
#include<cstdio>
#include<cstring>
#define I inline
using namespace std;

int n,m;

int gcd(int x,int y) {
	if(!y) return x;
	return gcd(y,x%y);
}
I void solve() {
	cin>>n>>m;
	if(gcd(m,n)!=1) {
		cout<<"No"<<endl;
		return ;
	}
	cout<<"Yes"<<endl;
	for(int i=1;i<=n;++i) {
		cout<<1+i*m<<' ';
	} cout<<endl;
	for(int i=1;i<=m;++i) {
		cout<<1+i*n<<' ';
	} cout<<endl;
}
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: 3584kb

input:

2
2 3
2 2

output:

Yes
4 7 
3 5 7 
No

result:

wrong answer Integer parameter [name=a[2]] equals to 7, violates the range [0, 5] (test case 1)