結果
| 問題 |
No.1198 お菓子配り-1
|
| コンテスト | |
| ユーザー |
okuramasafumi
|
| 提出日時 | 2020-11-13 19:23:08 |
| 言語 | Ruby (3.4.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 253 bytes |
| コンパイル時間 | 173 ms |
| コンパイル使用メモリ | 7,680 KB |
| 実行使用メモリ | 19,484 KB |
| 最終ジャッジ日時 | 2024-07-22 20:20:12 |
| 合計ジャッジ時間 | 4,775 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 WA * 2 |
| other | AC * 1 WA * 6 TLE * 1 -- * 6 |
コンパイルメッセージ
Syntax OK
ソースコード
n = gets.to_i
a = 3162277660168 # sqrt of 10**25
result = false
while a * 2 < n
b = 1
while a > b
val = a**2 - b**2
result = true and break if val == n
break if val < n
b += 1
end
break if result
a -= 1
end
puts result ? 1 : -1
okuramasafumi