結果

問題 No.537 ユーザーID
ユーザー rocoderrocoder
提出日時 2017-08-21 11:37:17
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 331 ms / 2,000 ms
コード長 1,093 bytes
コンパイル時間 116 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 11,136 KB
最終ジャッジ日時 2024-04-23 01:34:12
合計ジャッジ時間 5,191 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 26 ms
10,880 KB
testcase_01 AC 26 ms
10,880 KB
testcase_02 AC 25 ms
10,880 KB
testcase_03 AC 25 ms
11,008 KB
testcase_04 AC 26 ms
10,880 KB
testcase_05 AC 26 ms
10,880 KB
testcase_06 AC 26 ms
11,008 KB
testcase_07 AC 25 ms
10,880 KB
testcase_08 AC 25 ms
10,880 KB
testcase_09 AC 26 ms
10,880 KB
testcase_10 AC 26 ms
10,880 KB
testcase_11 AC 26 ms
10,880 KB
testcase_12 AC 27 ms
10,880 KB
testcase_13 AC 25 ms
10,752 KB
testcase_14 AC 26 ms
10,880 KB
testcase_15 AC 25 ms
11,008 KB
testcase_16 AC 26 ms
10,880 KB
testcase_17 AC 25 ms
10,752 KB
testcase_18 AC 223 ms
10,880 KB
testcase_19 AC 301 ms
10,880 KB
testcase_20 AC 270 ms
10,880 KB
testcase_21 AC 168 ms
11,008 KB
testcase_22 AC 268 ms
10,880 KB
testcase_23 AC 166 ms
10,880 KB
testcase_24 AC 68 ms
10,880 KB
testcase_25 AC 269 ms
10,752 KB
testcase_26 AC 302 ms
10,880 KB
testcase_27 AC 229 ms
10,880 KB
testcase_28 AC 146 ms
11,008 KB
testcase_29 AC 331 ms
11,136 KB
testcase_30 AC 279 ms
11,008 KB
testcase_31 AC 120 ms
10,880 KB
testcase_32 AC 128 ms
10,880 KB
testcase_33 AC 328 ms
10,880 KB
testcase_34 AC 217 ms
10,880 KB
権限があれば一括ダウンロードができます

ソースコード

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
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:
    k=int(str(i)+str(i))
    L=bs(k,L)
#c*=2
#if s==1:
 #   c-=1
print(len(L))
0