QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#780386 | #9799. Magical Palette | jiangzhihui | Compile Error | / | / | C++14 | 539b | 2024-11-25 10:34:26 | 2024-11-25 10:34:27 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std ;
void solve()
{
int n , m ;
cin >> n >> m ;
if(gcd(n , m) != 1)
{
cout << "No\n" ;
return ;
}
cout << "Yes\n" ;
for(int i = 0 ; i < n ; i ++) cout << (i * m + 1) % (n * m) << ' ' ; cout << '\n' ;
for(int i = 0 ; i < m ; i ++) cout << (i * n + 1) % (n * m) << ' ' ; cout << '\n' ;
}
int main()
{
std::ios::sync_with_stdio(false) , cin.tie(0) ;
int T ;
cin >> T ;
while(T --) solve() ;
return 0 ;
}
詳細信息
answer.code: In function ‘void solve()’: answer.code:7:8: error: ‘gcd’ was not declared in this scope 7 | if(gcd(n , m) != 1) | ^~~