QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#783024#9799. Magical Paletteyzy_21WA 0ms3672kbC++17695b2024-11-25 22:38:372024-11-25 22:38:39

Judging History

你现在查看的是最新测评结果

  • [2024-11-25 22:38:39]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3672kb
  • [2024-11-25 22:38:37]
  • 提交

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)