結果

問題 No.537 ユーザーID
ユーザー rocoder
提出日時 2017-08-21 11:31:55
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 1,079 bytes
コンパイル時間 160 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 11,008 KB
最終ジャッジ日時 2024-10-15 00:48:04
合計ジャッジ時間 5,731 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other AC * 26 WA * 5 RE * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

# your code goes here
#537 userid
def f(s,t):
    if s==t:
        return 0
    elif s<t:
        return -1
    else:
        return 1
def bs(gs,D):
    l=len(D)
    j=0
    ts=1
    if l>0:
        p=1
        m=l//2
        j+=m
        ts=f(gs,D[j])
        while m>1 and ts!=0:
            if ts*p>0:
                l-=m+1
            else:
                l=m
            m=l//2
            if ts<0:
                j-=m+1
                p=-1
            else:
                j+=m+1
                p=1
            ts=f(gs,D[j])
        if ts*p>0:
            l-=m+1
        else:
            l=m
        if l==1 and ts!=0:
            j+=ts
            ts=f(gs,D[j])
    if ts!=0:
        if ts==-1:
            ts=0
        D.insert(j+ts,gs)
    return D        
    #    print(ts
N=int(input())
i=1
c=0
s=0
L=[]
while i*i<N:
    if N%i==0:
        i1=N//i
        k=["",""]
        k[0]=int(str(i)+str(i1))
        k[1]=int(str(i1)+str(i))
        for j in range(2):
            L=bs(k[j],L)
    i+=1
if i*i==N:
    L=bs(k[j],L)
#c*=2
#if s==1:
 #   c-=1
print(len(L))
0