結果

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

テストケース

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

ソースコード

diff #

n = int(input())
s = input()
c = sum(s.count(e) for e in "AGCT")
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