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