結果

問題 No.1943 消えたAGCT(1)
ユーザー 炭酸水炭酸水
提出日時 2022-05-20 21:39:00
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
TLE  
実行時間 -
コード長 468 bytes
コンパイル時間 127 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 17,020 KB
最終ジャッジ日時 2024-09-20 07:34:02
合計ジャッジ時間 3,982 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 9 TLE * 1 -- * 17
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
s = input()

count = 0
sw = True

if s.count("A") + s.count("G") + s.count("C") + s.count("T") == 0:
    print(0)
    sw = False

while sw:
    x = s.count("A") + s.count("G") + s.count("C") + s.count("T")
    
    s = s[:x-1] + s[x:]
    
    x = s.count("A") + s.count("G") + s.count("C") + s.count("T")
    
    count += 1
    
    if x == 0:
        print(count)
        sw = False
    elif x == n:
        print(count + len(s))
        sw = False
0