結果
問題 |
No.1593 Perfect Distance
|
ユーザー |
|
提出日時 | 2021-11-12 21:55:00 |
言語 | Ruby (3.4.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 136 bytes |
コンパイル時間 | 515 ms |
コンパイル使用メモリ | 7,296 KB |
実行使用メモリ | 12,288 KB |
最終ジャッジ日時 | 2024-11-25 18:14:42 |
合計ジャッジ時間 | 3,022 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 6 WA * 11 |
コンパイルメッセージ
Syntax OK
ソースコード
N = gets.to_i cnt = 0 1.upto(Integer.sqrt(N)-1) {|i| n = N - i**2 next if n == 0 cnt += 1 if Integer.sqrt(n)**2 == n } puts cnt * 2