結果

問題 No.1943 消えたAGCT(1)
ユーザー pitPpitP
提出日時 2022-05-20 23:54:44
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 286 bytes
コンパイル時間 287 ms
コンパイル使用メモリ 81,480 KB
実行使用メモリ 101,636 KB
最終ジャッジ日時 2023-10-20 14:51:25
合計ジャッジ時間 2,827 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
53,304 KB
testcase_01 AC 37 ms
53,304 KB
testcase_02 AC 38 ms
53,304 KB
testcase_03 AC 37 ms
53,304 KB
testcase_04 AC 37 ms
53,304 KB
testcase_05 AC 37 ms
53,304 KB
testcase_06 AC 39 ms
53,304 KB
testcase_07 AC 37 ms
53,304 KB
testcase_08 AC 37 ms
53,304 KB
testcase_09 AC 107 ms
101,636 KB
testcase_10 AC 56 ms
62,944 KB
testcase_11 AC 56 ms
62,940 KB
testcase_12 AC 56 ms
62,944 KB
testcase_13 AC 52 ms
62,360 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 70 ms
71,924 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 86 ms
91,868 KB
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 58 ms
62,944 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import bisect
n = int(input())
s = input()
idx = []
c = 0
for i in range(n):
    if s[i] in ["A","C","G","T"]:
        c += 1
        idx.append(i+1)

if c == 0:
    print(0)
    exit()

if c == idx[-1]:
    print(c)
elif c < idx[0]:
    print(idx[-1])
else:
    print(idx[-1]-idx[0]+1)
0