QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#782845#9799. Magical Paletteyzy_21Compile Error//C++14600b2024-11-25 21:47:312024-11-25 21:47:39

Judging History

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

  • [2024-11-25 21:47:39]
  • 评测
  • [2024-11-25 21:47:31]
  • 提交

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(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;
}

详细

answer.code: In function ‘int main()’:
answer.code:11:12: error: ‘gcd’ was not declared in this scope
   11 |         if(gcd(n, m) == 1) {
      |            ^~~