結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 92 ms
12,288 KB
testcase_01 AC 89 ms
12,160 KB
testcase_02 AC 89 ms
12,160 KB
testcase_03 AC 90 ms
12,288 KB
testcase_04 AC 93 ms
12,160 KB
testcase_05 AC 97 ms
12,288 KB
testcase_06 AC 89 ms
12,160 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 89 ms
12,032 KB
testcase_10 WA -
testcase_11 AC 90 ms
12,032 KB
testcase_12 AC 91 ms
12,160 KB
testcase_13 AC 91 ms
12,160 KB
testcase_14 AC 91 ms
12,032 KB
testcase_15 AC 97 ms
12,160 KB
testcase_16 AC 95 ms
12,288 KB
testcase_17 AC 96 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 'No'
  else
    puts 'Yes'
  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