Submission #27741770


Source Code Expand

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);
}

Submission Info

Submission Time
Task E - Fraction Floor Sum
User ssvb
Language D (LDC 1.20.1)
Score 500
Code Size 481 Byte
Status AC
Exec Time 116 ms
Memory 3204 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 500 / 500
Status
AC × 2
AC × 22
Set Name Test Cases
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
Case Name Status Exec Time Memory
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