結果
問題 | No.278 連続する整数の和(2) |
ユーザー | vwxyz |
提出日時 | 2022-09-22 11:03:38 |
言語 | Python3 (3.11.6 + numpy 1.26.0 + scipy 1.11.3) |
結果 |
AC
|
実行時間 | 217 ms / 2,000 ms |
コード長 | 1,054 bytes |
コンパイル時間 | 92 ms |
コンパイル使用メモリ | 10,804 KB |
実行使用メモリ | 10,524 KB |
最終ジャッジ日時 | 2023-08-23 20:28:35 |
合計ジャッジ時間 | 3,067 ms |
ジャッジサーバーID (参考情報) |
judge14 / judge13 |
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 35 ms
10,392 KB |
testcase_01 | AC | 33 ms
10,524 KB |
testcase_02 | AC | 185 ms
10,360 KB |
testcase_03 | AC | 33 ms
10,404 KB |
testcase_04 | AC | 33 ms
10,328 KB |
testcase_05 | AC | 36 ms
10,400 KB |
testcase_06 | AC | 37 ms
10,340 KB |
testcase_07 | AC | 36 ms
10,412 KB |
testcase_08 | AC | 179 ms
10,364 KB |
testcase_09 | AC | 177 ms
10,468 KB |
testcase_10 | AC | 217 ms
10,524 KB |
testcase_11 | AC | 172 ms
10,464 KB |
testcase_12 | AC | 35 ms
10,388 KB |
testcase_13 | AC | 149 ms
10,392 KB |
testcase_14 | AC | 124 ms
10,400 KB |
testcase_15 | AC | 131 ms
10,368 KB |
testcase_16 | AC | 111 ms
10,368 KB |
testcase_17 | AC | 180 ms
10,360 KB |
ソースコード
import bisect import copy import decimal import fractions import heapq import itertools import math import random import sys import time from collections import Counter,deque,defaultdict from functools import lru_cache,reduce from heapq import heappush,heappop,heapify,heappushpop,_heappop_max,_heapify_max def _heappush_max(heap,item): heap.append(item) heapq._siftdown_max(heap, 0, len(heap)-1) def _heappushpop_max(heap, item): if heap and item < heap[0]: item, heap[0] = heap[0], item heapq._siftup_max(heap, 0) return item from math import gcd as GCD read=sys.stdin.read readline=sys.stdin.readline readlines=sys.stdin.readlines write=sys.stdout.write def Divisors(N): divisors=[] for i in range(1,N+1): if i**2>=N: break elif N%i==0: divisors.append(i) if i**2==N: divisors+=[i]+[N//i for i in divisors[::-1]] else: divisors+=[N//i for i in divisors[::-1]] return divisors N=int(readline()) ans=sum(Divisors(GCD(N,N*(N-1)//2))) print(ans)