QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#882839 | #9768. A + B = C Problem | forgotmyhandle | Compile Error | / | / | C++14 | 613b | 2025-02-05 11:51:41 | 2025-02-05 11:51:42 |
Judging History
This is the latest submission verdict.
- [2025-02-05 11:51:42]
- Judged
- Verdict: Compile Error
- Time: 0ms
- Memory: 0kb
- [2025-02-05 11:51:41]
- Submitted
answer
#include <iostream>
#define int long long
using namespace std;
signed main() {
int tc;
cin >> tc;
while (tc--) {
int a, b, c;
cin >> a >> b >> c;
if (a * b / __gcd(a, b) != c) {
cout << "NO\n";
continue;
}
string A = "0", B = "0", C;
for (int i = 1; i < a; i++) A += '1';
for (int i = 1; i < b; i++) B += '1';
cout << "YES\n";
cout << A << "\n" << B << "\n";
for (int i = 0; i < c; i++) cout << (char)('0' + (A[i % a] ^ B[i % b]));
cout << "\n";
}
return 0;
}
詳細信息
answer.code: In function ‘int main()’: answer.code:10:21: error: ‘__gcd’ was not declared in this scope; did you mean ‘__gid_t’? 10 | if (a * b / __gcd(a, b) != c) { | ^~~~~ | __gid_t