結果
| 問題 |
No.278 連続する整数の和(2)
|
| コンテスト | |
| ユーザー |
小指が強い人
|
| 提出日時 | 2015-11-08 13:55:52 |
| 言語 | Ruby (3.4.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 241 bytes |
| コンパイル時間 | 86 ms |
| コンパイル使用メモリ | 7,552 KB |
| 実行使用メモリ | 12,288 KB |
| 最終ジャッジ日時 | 2024-09-13 14:09:05 |
| 合計ジャッジ時間 | 3,526 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 9 WA * 9 |
コンパイルメッセージ
Syntax OK
ソースコード
n = gets.to_i
sn = n * (n - 1) / 2
t = Math.sqrt(n).to_i
res = 0
t.times do |x|
x += 1
if n % x != 0 || sn % x != 0 then
next
end
res += x
ax = n / x
if sn % ax == 0 then
res += ax
end
end
puts res
小指が強い人