QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#789926 | #9799. Magical Palette | idestiny | WA | 0ms | 3720kb | C++14 | 660b | 2024-11-27 22:49:09 | 2024-11-27 22:49:09 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
void solve(){
int n,m;
cin>>n>>m;
map<int,int> mp;
// for(int i=0;i<n;i++){
// }
if(__gcd(n,m)!=1) printf("No\n");
else{
printf("Yes\n");
for(int i=1;i<n;i++){
printf("%d ",i*m+1);
}
printf("\n");
for(int i=1;i<m;i++){
printf("%d ",i*n+1);
}
printf("\n");
}
// for(int i=0;i<n*m;i++){
// for(int j=0;j<n*m;j++){
// }
// }
}
int main(){
ios::sync_with_stdio(0);
cin.tie(0);
int t;
cin>>t;
while(t--) solve();
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3720kb
input:
2 2 3 2 2
output:
Yes 4 3 5 No
result:
wrong output format Expected integer, but "No" found (test case 1)