QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#793194 | #9799. Magical Palette | kazimiyuuka | WA | 0ms | 3668kb | C++20 | 1.1kb | 2024-11-29 17:32:29 | 2024-11-29 17:32:32 |
Judging History
answer
#include <iostream>
#include <string>
#include <string.h>
#include <vector>
#include <algorithm>
#include <cmath>
#include <set>
#include <random>
#include <cstdlib>
#include <numeric>
#include <functional>
#include <queue>
#include <stdlib.h>
#include <map>
#include <assert.h>
using namespace std;
using ll = long long;
ll mod = 998244353;
void slove() {
int a, b;
cin >> a >> b;
if (gcd(a, b) != 1) {
cout << "NO\n";
}
else {
cout << "YES\n";
int s = b == 1 ? 0 : 1;
for (int i = 1; i <= a; i++ , s += b) {
cout << s << " ";
}
cout << "\n";
s = a == 1 ? 0 : 1;
for (int i = 1; i <= b; i++, s += a) {
cout << s << " ";
}
cout << "\n";
}
}
signed main() {
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
//freopen("in.txt", "r", stdin);
//freopen("out.txt", "w", stdout);
int cnt = 1;
cin >> cnt;
while (cnt--) {
slove();
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3668kb
input:
2 2 3 2 2
output:
YES 1 4 1 3 5 NO
result:
wrong answer Token parameter [name=verdict] equals to "YES", doesn't correspond to pattern "Yes|No" (test case 1)