結果

問題 No.1943 消えたAGCT(1)
ユーザー hirakuhiraku
提出日時 2022-05-20 22:34:20
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 251 bytes
コンパイル時間 536 ms
コンパイル使用メモリ 11,780 KB
実行使用メモリ 11,024 KB
最終ジャッジ日時 2023-10-20 13:19:43
合計ジャッジ時間 2,173 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 28 ms
9,948 KB
testcase_01 AC 27 ms
9,948 KB
testcase_02 AC 26 ms
9,948 KB
testcase_03 AC 26 ms
9,948 KB
testcase_04 AC 27 ms
9,948 KB
testcase_05 AC 27 ms
9,948 KB
testcase_06 AC 28 ms
9,948 KB
testcase_07 AC 26 ms
9,948 KB
testcase_08 AC 28 ms
9,948 KB
testcase_09 AC 29 ms
10,920 KB
testcase_10 AC 29 ms
10,920 KB
testcase_11 AC 29 ms
10,920 KB
testcase_12 AC 29 ms
10,920 KB
testcase_13 AC 28 ms
10,348 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 30 ms
10,920 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 33 ms
10,920 KB
testcase_23 WA -
testcase_24 AC 31 ms
10,920 KB
testcase_25 AC 30 ms
10,920 KB
testcase_26 AC 29 ms
10,920 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
s = input()
c = sum(s.count(e) for e in "AGCT") - 1
l = max(0, min(s.find(e) for e in "AGCT"))
r = max(0, max(s.rfind(e) for e in "AGCT"))
if c == -1:
    print(0)
else:
    # print(c, l, r)
    print(max(c, l, r) - min(c, l, r) + 1)
0