QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#805517#9799. Magical PaletteWTR2007WA 0ms3800kbC++20992b2024-12-08 17:01:402024-12-08 17:01:44

Judging History

This is the latest submission verdict.

  • [2024-12-08 17:01:44]
  • Judged
  • Verdict: WA
  • Time: 0ms
  • Memory: 3800kb
  • [2024-12-08 17:01:40]
  • Submitted

answer

#include<bits/stdc++.h>
#define fi first
#define se second
#define MULT_TEST 1
using namespace std;
typedef long double ldb;
typedef unsigned long long ull;
const int INF = 0x3f3f3f3f;
const int MOD = 998244353;
inline int read() {
    int w = 0, f = 1;
    char ch = getchar();
    while (ch < '0' || ch > '9') {
        if (ch == '-') f = -1;
        ch = getchar();
    }
    while (ch >= '0' && ch <= '9') {
        w = (w << 1) + (w << 3) + ch - 48;
        ch = getchar();
    }
    return w * f;
}
inline void Solve() {
    int n, m;
    n = read(), m = read();
    if (__gcd(n, m) != 1) printf("No\n");
    else {
        printf("Yes\n");
        for (int i = 1; i <= m; i++) printf("%d ", (i * n + 1) % (n * m));
        puts("");
        for (int i = 1; i <= n; i++) printf("%d ", (i * m + 1) % (n * m));
        puts("");
    } 
}
signed main() {
    int _ = 1;
#if MULT_TEST
    _ = read();
#endif 
    while (_--) Solve();
    return 0;
}

詳細信息

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3800kb

input:

2
2 3
2 2

output:

Yes
3 5 1 
4 1 
No

result:

wrong answer Duplicated Color 3 (test case 1)