結果

問題 No.1218 Something Like a Theorem
ユーザー maimai
提出日時 2020-09-04 21:28:15
言語 Ruby
(3.3.0)
結果
TLE  
実行時間 -
コード長 256 bytes
コンパイル時間 104 ms
コンパイル使用メモリ 7,552 KB
実行使用メモリ 17,792 KB
最終ジャッジ日時 2024-05-04 21:34:02
合計ジャッジ時間 8,360 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 97 ms
17,536 KB
testcase_01 AC 302 ms
12,160 KB
testcase_02 AC 100 ms
12,160 KB
testcase_03 AC 109 ms
12,160 KB
testcase_04 AC 99 ms
12,160 KB
testcase_05 AC 97 ms
12,160 KB
testcase_06 AC 275 ms
12,160 KB
testcase_07 AC 150 ms
12,160 KB
testcase_08 AC 168 ms
12,288 KB
testcase_09 AC 286 ms
12,288 KB
testcase_10 AC 129 ms
12,032 KB
testcase_11 AC 287 ms
12,160 KB
testcase_12 AC 100 ms
12,032 KB
testcase_13 AC 275 ms
12,032 KB
testcase_14 AC 278 ms
12,160 KB
testcase_15 AC 1,762 ms
12,416 KB
testcase_16 TLE -
testcase_17 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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..1000).each do |x|
  (1..1000).each do |y|
    if x**n+y**n == z**n
      puts 'Yes'
      exit
    end
  end
end
puts 'No'
0