結果

問題 No.1556 Power Equality
ユーザー tamura2004tamura2004
提出日時 2021-06-26 19:15:29
言語 Crystal
(1.11.2)
結果
AC  
実行時間 3 ms / 2,000 ms
コード長 174 bytes
コンパイル時間 20,001 ms
コンパイル使用メモリ 253,668 KB
実行使用メモリ 4,504 KB
最終ジャッジ日時 2023-09-07 15:56:18
合計ジャッジ時間 19,170 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
4,408 KB
testcase_01 AC 3 ms
4,504 KB
testcase_02 AC 3 ms
4,420 KB
testcase_03 AC 3 ms
4,376 KB
testcase_04 AC 3 ms
4,400 KB
testcase_05 AC 3 ms
4,420 KB
testcase_06 AC 2 ms
4,424 KB
testcase_07 AC 3 ms
4,500 KB
testcase_08 AC 2 ms
4,500 KB
testcase_09 AC 3 ms
4,380 KB
testcase_10 AC 2 ms
4,420 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

a,b = gets.to_s.split.map(&.to_i64)

case
when a == b
  puts "Yes"
when a % b == 0 && b * b == a
  puts "Yes"
when b % a == 0 && a * a == b
  puts "Yes"
else
  puts "No"
end
0