結果

問題 No.1439 Let's Compare!!!!
ユーザー da_abda_ab
提出日時 2021-03-27 04:34:21
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 1,138 bytes
コンパイル時間 264 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 51,348 KB
最終ジャッジ日時 2024-05-06 21:47:02
合計ジャッジ時間 11,988 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 477 ms
49,396 KB
testcase_01 AC 448 ms
44,264 KB
testcase_02 AC 449 ms
44,268 KB
testcase_03 AC 447 ms
44,044 KB
testcase_04 AC 456 ms
44,292 KB
testcase_05 AC 456 ms
44,396 KB
testcase_06 AC 455 ms
44,264 KB
testcase_07 AC 721 ms
44,264 KB
testcase_08 AC 799 ms
44,404 KB
testcase_09 AC 513 ms
43,756 KB
testcase_10 TLE -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

# 1439 : Let's Compare!!!!

import numpy as np
from sys import stdin

N=int(stdin.readline())
if N<1000:
    blockSize=N
else:
    blockSize=1000

S=0
T=1
paddingSize=(blockSize-N%blockSize)%blockSize
padding="0"*paddingSize
N+=paddingSize
strS=padding+stdin.readline().rstrip()
strT=padding+stdin.readline().rstrip()
strST=[0]*2
strST[S]=[0]*int(np.floor(N/blockSize))
strST[T]=[0]*int(np.floor(N/blockSize))
k=0
for i in range(int(np.floor(N/blockSize))):
    strST[S][i]=strS[k:k+blockSize]
    strST[T][i]=strT[k:k+blockSize]
    k+=blockSize
Q=int(stdin.readline())

for _ in range(Q):
    c,x,y=stdin.readline().split()
    x=(int(x)-1)+paddingSize
    if c=='S':
        tStr=S
    else:
        tStr=T
    nThBlock=int(np.floor(x/blockSize))
    nThChar=x%blockSize
    strST[tStr][nThBlock]=strST[tStr][nThBlock][0:nThChar]+y+strST[tStr][nThBlock][nThChar+1:]
    result='='
    for i in range(int(np.floor(N/blockSize))):
        intS=int(strST[S][i])
        intT=int(strST[T][i])
        if strST[S]>strST[T]:
            result='>'
            break
        elif strST[S]<strST[T]:
            result='<'
    print(result)


0