結果
問題 |
No.1113 二つの整数 / Two Integers
|
ユーザー |
|
提出日時 | 2020-07-19 06:45:03 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 1 ms / 1,000 ms |
コード長 | 386 bytes |
コンパイル時間 | 475 ms |
コンパイル使用メモリ | 49,280 KB |
最終ジャッジ日時 | 2025-01-12 00:47:02 |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 15 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:18:18: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 18 | i64 a, b; scanf("%ld%ld", &a, &b); | ~~~~~^~~~~~~~~~~~~~~~~~
ソースコード
#include <cmath> #include <cstdint> #include <cstdio> using namespace std; using i64 = int64_t; bool is_square(i64 n) { i64 sq = static_cast<i64>(sqrt(n)); return sq*sq == n; } i64 gcd(i64 a, i64 b) { if(b == 0) { return a; } return gcd(b, a%b); } int main(void) { i64 a, b; scanf("%ld%ld", &a, &b); i64 g = gcd(a, b); puts(is_square(g) ? "Odd" : "Even"); return 0; }