結果

問題 No.1943 消えたAGCT(1)
ユーザー pitPpitP
提出日時 2022-05-20 21:48:50
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 269 bytes
コンパイル時間 174 ms
コンパイル使用メモリ 11,832 KB
実行使用メモリ 30,852 KB
最終ジャッジ日時 2023-10-20 12:19:00
合計ジャッジ時間 4,087 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
10,152 KB
testcase_01 AC 29 ms
10,152 KB
testcase_02 AC 29 ms
10,152 KB
testcase_03 AC 29 ms
10,152 KB
testcase_04 AC 29 ms
10,152 KB
testcase_05 AC 29 ms
10,152 KB
testcase_06 AC 29 ms
10,152 KB
testcase_07 AC 29 ms
10,152 KB
testcase_08 AC 29 ms
10,152 KB
testcase_09 AC 214 ms
30,852 KB
testcase_10 AC 135 ms
11,116 KB
testcase_11 AC 141 ms
11,116 KB
testcase_12 AC 136 ms
11,116 KB
testcase_13 AC 95 ms
10,616 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 147 ms
13,380 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 187 ms
24,300 KB
testcase_23 WA -
testcase_24 AC 141 ms
11,116 KB
testcase_25 AC 140 ms
11,116 KB
testcase_26 AC 139 ms
11,116 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)

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

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