結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 26 ms
11,008 KB
testcase_01 AC 26 ms
10,880 KB
testcase_02 WA -
testcase_03 AC 26 ms
10,880 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 27 ms
10,880 KB
testcase_08 AC 26 ms
11,008 KB
testcase_09 RE -
testcase_10 AC 24 ms
10,880 KB
testcase_11 WA -
testcase_12 AC 25 ms
10,880 KB
testcase_13 AC 24 ms
10,880 KB
testcase_14 AC 24 ms
10,880 KB
testcase_15 AC 25 ms
10,880 KB
testcase_16 AC 26 ms
10,880 KB
testcase_17 AC 26 ms
10,880 KB
testcase_18 AC 221 ms
10,880 KB
testcase_19 AC 287 ms
10,880 KB
testcase_20 AC 252 ms
10,880 KB
testcase_21 AC 169 ms
10,880 KB
testcase_22 AC 315 ms
10,880 KB
testcase_23 AC 172 ms
10,880 KB
testcase_24 AC 67 ms
10,880 KB
testcase_25 AC 265 ms
10,880 KB
testcase_26 WA -
testcase_27 AC 219 ms
10,880 KB
testcase_28 AC 142 ms
11,008 KB
testcase_29 AC 318 ms
11,136 KB
testcase_30 AC 310 ms
11,136 KB
testcase_31 AC 110 ms
10,880 KB
testcase_32 AC 120 ms
10,880 KB
testcase_33 AC 350 ms
11,008 KB
testcase_34 AC 215 ms
11,008 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
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