結果

問題 No.1943 消えたAGCT(1)
ユーザー june19312june19312
提出日時 2022-05-20 22:37:57
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 429 bytes
コンパイル時間 427 ms
コンパイル使用メモリ 81,708 KB
実行使用メモリ 79,856 KB
最終ジャッジ日時 2023-10-20 13:24:18
合計ジャッジ時間 4,913 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
53,488 KB
testcase_01 AC 37 ms
53,448 KB
testcase_02 AC 37 ms
53,448 KB
testcase_03 AC 37 ms
53,448 KB
testcase_04 AC 37 ms
53,448 KB
testcase_05 AC 38 ms
53,448 KB
testcase_06 AC 38 ms
53,448 KB
testcase_07 AC 39 ms
53,448 KB
testcase_08 AC 37 ms
53,448 KB
testcase_09 AC 80 ms
79,856 KB
testcase_10 AC 59 ms
64,676 KB
testcase_11 AC 70 ms
79,856 KB
testcase_12 TLE -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
s = input()
AGCT = ["A","G","C","T"]

tmp = [True]*(len(s))
cnt = 0

for i,v in enumerate(s):
    if v in AGCT:
        cnt+=1

ans = 0
while cnt>0:
    tmp2 = cnt-1
    flag = True

    while flag:
        if tmp[tmp2]:
            tmp[tmp2]=False
            if s[tmp2] in AGCT:
                cnt-=1
            ans+=1
            flag = False
            break
        else:
            tmp2+=1

print(ans)
0