QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#866126 | #9799. Magical Palette | Nana7 | WA | 1ms | 3584kb | C++14 | 483b | 2025-01-22 12:37:59 | 2025-01-22 12:37:59 |
Judging History
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)