提出 #27741770


ソースコード 拡げる

import std.algorithm, std.array, std.container, std.conv, std.math, std.numeric, std.random, std.range, std.stdio, std.string, std.typecons, core.bitop;

void main()
{
  long n;
  readf!" %d "(n);
  long ans;
  long i = n;
  while (i != 0) {
    long val = n / i;
    auto cnt = iota(1, i + 1).map!(x => (n / x == val))
               .assumeSorted.upperBound!(SearchPolicy.gallopBackwards)(false).length;
    ans += cnt * val;
    i -= cnt;
  }
  writeln(ans);
}

提出情報

提出日時
問題 E - Fraction Floor Sum
ユーザ ssvb
言語 D (LDC 1.20.1)
得点 500
コード長 481 Byte
結果 AC
実行時間 116 ms
メモリ 3204 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 500 / 500
結果
AC × 2
AC × 22
セット名 テストケース
Sample example_00.txt, example_01.txt
All example_00.txt, example_01.txt, random_00.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, random_10.txt, random_11.txt, random_12.txt, random_13.txt, random_14.txt, random_15.txt, random_16.txt, random_17.txt, random_18.txt, random_19.txt
ケース名 結果 実行時間 メモリ
example_00.txt AC 12 ms 3164 KiB
example_01.txt AC 23 ms 3156 KiB
random_00.txt AC 112 ms 3040 KiB
random_01.txt AC 115 ms 3068 KiB
random_02.txt AC 114 ms 3092 KiB
random_03.txt AC 4 ms 3144 KiB
random_04.txt AC 3 ms 3004 KiB
random_05.txt AC 3 ms 3140 KiB
random_06.txt AC 64 ms 3056 KiB
random_07.txt AC 67 ms 3004 KiB
random_08.txt AC 48 ms 3204 KiB
random_09.txt AC 87 ms 3040 KiB
random_10.txt AC 109 ms 3084 KiB
random_11.txt AC 112 ms 3056 KiB
random_12.txt AC 89 ms 3072 KiB
random_13.txt AC 81 ms 3160 KiB
random_14.txt AC 113 ms 2988 KiB
random_15.txt AC 116 ms 3016 KiB
random_16.txt AC 112 ms 3028 KiB
random_17.txt AC 116 ms 3060 KiB
random_18.txt AC 110 ms 3064 KiB
random_19.txt AC 113 ms 3084 KiB