結果

問題 No.1218 Something Like a Theorem
ユーザー maimai
提出日時 2020-09-04 21:26:49
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 252 bytes
コンパイル時間 49 ms
コンパイル使用メモリ 7,552 KB
実行使用メモリ 12,416 KB
最終ジャッジ日時 2024-05-04 21:30:20
合計ジャッジ時間 2,203 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
12,160 KB
testcase_01 AC 77 ms
12,160 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 77 ms
12,288 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 78 ms
12,416 KB
testcase_10 WA -
testcase_11 AC 78 ms
12,160 KB
testcase_12 AC 73 ms
12,032 KB
testcase_13 AC 82 ms
12,160 KB
testcase_14 AC 79 ms
12,160 KB
testcase_15 AC 82 ms
12,160 KB
testcase_16 AC 83 ms
12,288 KB
testcase_17 AC 79 ms
12,288 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

def lscan; gets.split.map(&:to_i); end

n, z = lscan

if n == 1
  if z == 1
    puts 'Yes'
  else
    puts 'No'
  end
  exit
end

(1..30).each do |x|
  (1..30).each do |y|
    if x**n+y**n == z**n
      puts 'Yes'
      exit
    end
  end
end
puts 'No'
0