結果
問題 | No.278 連続する整数の和(2) |
ユーザー |
![]() |
提出日時 | 2015-09-04 22:33:33 |
言語 | Ruby (3.4.1) |
結果 |
AC
|
実行時間 | 249 ms / 2,000 ms |
コード長 | 180 bytes |
コンパイル時間 | 54 ms |
コンパイル使用メモリ | 7,424 KB |
実行使用メモリ | 12,288 KB |
最終ジャッジ日時 | 2024-12-23 08:59:54 |
合計ジャッジ時間 | 3,693 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 18 |
コンパイルメッセージ
Syntax OK
ソースコード
n = gets.to_isum = n * (n + 1) / 2d = n.gcd(sum)ans = 0(1..d).each { |i|break if i * i > dif d % i == 0ans += ians += d / iendans -= i if i * i == d}puts ans