提出 #19812242


ソースコード 拡げる

import sys
input = sys.stdin.readline
import numpy as np
import time


#    int(input())
#    input().split().strip()
#    map(int, input().strip().split())


def calc_one_to_n(n):
    return n*(n+1)//2

n = int(input())
cnt = 0

top = min(int(np.sqrt(n))*2, 10**8)

for i in range(1, top):
    nn1 = calc_one_to_n(i)
    if nn1 > n:
        break
    an = n - nn1
    if an % i == 0:
        cnt += 1

print(cnt*2)

提出情報

提出日時
問題 D - Staircase Sequences
ユーザ rsypoz
言語 Python (3.8.2)
得点 400
コード長 444 Byte
結果 AC
実行時間 761 ms
メモリ 27172 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 400 / 400
結果
AC × 3
AC × 33
セット名 テストケース
Sample 01_sample.txt, 02_sample.txt, 03_sample.txt
All 01_sample.txt, 02_sample.txt, 03_sample.txt, 04_hand.txt, 05_hand.txt, 06_hand.txt, 07_small.txt, 08_small.txt, 09_small.txt, 10_small.txt, 11_small.txt, 12_large.txt, 13_large.txt, 14_large.txt, 15_large.txt, 16_large.txt, 17_large.txt, 18_large.txt, 19_large.txt, 20_power.txt, 21_power.txt, 22_power.txt, 23_power.txt, 24_power.txt, 25_power.txt, 26_power.txt, 27_power.txt, 28_power.txt, 29_power.txt, 30_prod.txt, 31_prod.txt, 32_prod.txt, 33_prod.txt
ケース名 結果 実行時間 メモリ
01_sample.txt AC 128 ms 26816 KiB
02_sample.txt AC 123 ms 26784 KiB
03_sample.txt AC 655 ms 27168 KiB
04_hand.txt AC 616 ms 26944 KiB
05_hand.txt AC 761 ms 26944 KiB
06_hand.txt AC 661 ms 26948 KiB
07_small.txt AC 125 ms 27124 KiB
08_small.txt AC 126 ms 27172 KiB
09_small.txt AC 122 ms 27096 KiB
10_small.txt AC 121 ms 26936 KiB
11_small.txt AC 127 ms 27004 KiB
12_large.txt AC 150 ms 26944 KiB
13_large.txt AC 132 ms 26840 KiB
14_large.txt AC 170 ms 26952 KiB
15_large.txt AC 147 ms 27172 KiB
16_large.txt AC 122 ms 26872 KiB
17_large.txt AC 127 ms 27080 KiB
18_large.txt AC 133 ms 26816 KiB
19_large.txt AC 123 ms 26784 KiB
20_power.txt AC 464 ms 27088 KiB
21_power.txt AC 220 ms 26600 KiB
22_power.txt AC 442 ms 27160 KiB
23_power.txt AC 133 ms 26856 KiB
24_power.txt AC 121 ms 26796 KiB
25_power.txt AC 564 ms 26588 KiB
26_power.txt AC 261 ms 26868 KiB
27_power.txt AC 125 ms 26816 KiB
28_power.txt AC 143 ms 26932 KiB
29_power.txt AC 161 ms 26936 KiB
30_prod.txt AC 684 ms 27168 KiB
31_prod.txt AC 666 ms 26812 KiB
32_prod.txt AC 648 ms 26816 KiB
33_prod.txt AC 607 ms 26872 KiB