結果
問題 | No.1036 Make One With GCD 2 |
ユーザー |
![]() |
提出日時 | 2020-04-25 16:57:49 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
TLE
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 304 bytes |
コンパイル時間 | 315 ms |
コンパイル使用メモリ | 12,416 KB |
実行使用メモリ | 156,152 KB |
最終ジャッジ日時 | 2024-11-07 21:19:16 |
合計ジャッジ時間 | 49,806 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 37 TLE * 4 |
ソースコード
from numpy import *N=int(input())A=int64(input().split()+[1])s=ones((20,N+1),int64)s[0]=Afor n in range(19):d=1<<ns[n+1,:-d]=gcd(s[n,:-d],s[n,d:])L=arange(N)R=copy(L)G=zeros(N,int64)for n in range(19, -1, -1):H=gcd(G,s[n][R])g=H!=1R[g]+=1<<nG[g]=H[g]print(N*(N+1)//2-sum(R-L))