結果

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

テストケース

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

ソースコード

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 == 0:
    print(0)
else:
    # print(c, l, r)
    print(max(c, l, r) - min(c, l, r) + 1)
0