QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#783024 | #9799. Magical Palette | yzy_21 | WA | 0ms | 3672kb | C++17 | 695b | 2024-11-25 22:38:37 | 2024-11-25 22:38:39 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
#define int long long
signed main() {
ios::sync_with_stdio(0);
cin.tie(0);
int t;cin >> t;
while(t--) {
int n, m;cin >> n >> m;
if(n == 1 or m == 1) {
cout << "No\n";
continue;
}
if(gcd(n, m) == 1) {
cout << "Yes\n";
for(int i = 1; i <= n; ++i) {
cout << 1 + (i - 1) * m << " ";
}
cout << "\n";
for(int i = 1; i <= m; ++i) {
cout << 1 + (i - 1) * n << " ";
}
cout << "\n";
}
else cout << "No\n";
}
return 0;
}
詳細信息
Test #1:
score: 100
Accepted
time: 0ms
memory: 3648kb
input:
2 2 3 2 2
output:
Yes 1 4 1 3 5 No
result:
ok 2 cases (2 test cases)
Test #2:
score: -100
Wrong Answer
time: 0ms
memory: 3672kb
input:
1 1 1000000
output:
No
result:
wrong answer Wrong Verdict (test case 1)