QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#786795 | #9799. Magical Palette | EZGG | WA | 0ms | 3648kb | C++23 | 640b | 2024-11-26 23:31:44 | 2024-11-26 23:31:45 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
void solve()
{
int n, m;
cin >> n >> m;
if (gcd(n, m) == 1)
{
cout << "Yes" << endl;
}
else
{
cout << "No" << endl;
return;
}
for (int i = 1; i <= n; i++)
cout << m * i + 1 << ' ';
cout << '\n';
for (int i = 1; i <= m; i++)
cout << n * i + 1 << ' ';
cout << '\n';
}
int main()
{
#if !LOCAL
ios::sync_with_stdio(0);
cin.tie(0);
#endif
int tt = 1;
cin >> tt;
while (tt--)
solve();
#if LOCAL
system("pause");
#endif
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3648kb
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)