結果
問題 |
No.278 連続する整数の和(2)
|
ユーザー |
![]() |
提出日時 | 2016-08-09 05:14:56 |
言語 | Ruby (3.4.1) |
結果 |
RE
|
実行時間 | - |
コード長 | 262 bytes |
コンパイル時間 | 70 ms |
コンパイル使用メモリ | 7,552 KB |
実行使用メモリ | 12,416 KB |
最終ジャッジ日時 | 2024-11-07 07:43:10 |
合計ジャッジ時間 | 2,458 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | RE * 18 |
コンパイルメッセージ
Syntax OK
ソースコード
N = gets.to_i sum = N * (N - 1) / 2 ans = 0 1.upto(Math.sqrt(N).floor) {|i| if N % i == 0 if sum % i == 0 ans += i map[i] = 1 end if sum % (N / i) == 0 and i != N / i ans += N / i map[N / i] = 1 end end } puts ans