結果
問題 | No.278 連続する整数の和(2) |
ユーザー |
![]() |
提出日時 | 2016-08-09 05:15:11 |
言語 | Ruby (3.4.1) |
結果 |
AC
|
実行時間 | 225 ms / 2,000 ms |
コード長 | 225 bytes |
コンパイル時間 | 39 ms |
コンパイル使用メモリ | 7,424 KB |
実行使用メモリ | 12,160 KB |
最終ジャッジ日時 | 2024-12-23 09:12:13 |
合計ジャッジ時間 | 3,691 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 18 |
コンパイルメッセージ
Syntax OK
ソースコード
N = gets.to_isum = N * (N - 1) / 2ans = 01.upto(Math.sqrt(N).floor) {|i|if N % i == 0if sum % i == 0ans += iendif sum % (N / i) == 0 and i != N / ians += N / iendend}puts ans