QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#786795#9799. Magical PaletteEZGGWA 0ms3648kbC++23640b2024-11-26 23:31:442024-11-26 23:31:45

Judging History

This is the latest submission verdict.

  • [2024-11-26 23:31:45]
  • Judged
  • Verdict: WA
  • Time: 0ms
  • Memory: 3648kb
  • [2024-11-26 23:31:44]
  • Submitted

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)