QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#784500#9799. Magical PaletteWilliamHuWA 0ms3532kbC++17822b2024-11-26 15:10:432024-11-26 15:10:44

Judging History

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

  • [2024-11-26 15:10:44]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3532kb
  • [2024-11-26 15:10:43]
  • 提交

answer

#include<bits/stdc++.h>
#define int long long
using namespace std;
int read()
{
	int x = 0, f = 1;
	char c = getchar();
	while(c != EOF and !isdigit(c))
	{
		if(c == '-')f = -1;
		c = getchar();
	}
	while(isdigit(c))
	{
		x = x * 10 + c - '0';
		c = getchar();
	}
	return x * f;
}


int n, m;
signed main()
{
	int T = read();
	while(T --)
	{
		n = read();
		m = read();
		int d = __gcd(n, m);
		if(d != 1)
		{
			cout<<"No\n";
			continue;
		}
		cout<<"Yes\n";
		if(n < m)
		{
			for(int i = 0;i < n;i ++)cout<<i<<' ';
			cout<<'\n';
			for(int i = 0;i < m;i ++)cout<<1+i*n<<' ';
			cout<<endl;
		}
		else 
		{
			for(int i = 0;i < n;i ++)cout<<1+i*m<<' ';
			cout<<'\n';
			for(int i = 0;i < m;i ++)cout<<i<<' ';
			cout<<endl;
		}
	}
	return 0;
}
//8
//1 2 3 1 3 4 3

詳細信息

Test #1:

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

input:

2
2 3
2 2

output:

Yes
0 1 
1 3 5 
No

result:

wrong answer Duplicated Color 0 (test case 1)