結果

問題 No.1943 消えたAGCT(1)
ユーザー RainkunchRainkunch
提出日時 2022-05-20 23:36:22
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 113 ms / 2,000 ms
コード長 467 bytes
コンパイル時間 2,037 ms
コンパイル使用メモリ 81,532 KB
実行使用メモリ 134,928 KB
最終ジャッジ日時 2023-10-20 14:32:39
合計ジャッジ時間 3,347 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
53,368 KB
testcase_01 AC 30 ms
53,368 KB
testcase_02 AC 30 ms
53,368 KB
testcase_03 AC 29 ms
53,368 KB
testcase_04 AC 33 ms
53,368 KB
testcase_05 AC 32 ms
53,368 KB
testcase_06 AC 34 ms
53,368 KB
testcase_07 AC 32 ms
53,368 KB
testcase_08 AC 33 ms
53,368 KB
testcase_09 AC 109 ms
134,928 KB
testcase_10 AC 79 ms
100,648 KB
testcase_11 AC 82 ms
100,652 KB
testcase_12 AC 88 ms
100,648 KB
testcase_13 AC 53 ms
77,460 KB
testcase_14 AC 44 ms
61,668 KB
testcase_15 AC 88 ms
101,128 KB
testcase_16 AC 65 ms
86,180 KB
testcase_17 AC 86 ms
97,708 KB
testcase_18 AC 92 ms
103,204 KB
testcase_19 AC 90 ms
103,216 KB
testcase_20 AC 89 ms
103,212 KB
testcase_21 AC 90 ms
103,216 KB
testcase_22 AC 113 ms
121,044 KB
testcase_23 AC 110 ms
121,044 KB
testcase_24 AC 85 ms
100,652 KB
testcase_25 AC 84 ms
100,648 KB
testcase_26 AC 80 ms
100,648 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
s = list(input())
counter = 0
start = s.count('A') + s.count('G') + s.count('C') + s.count('T')
checklist = ['A','G','C','T']
f = [0]*n
for sn in range(n):
    if s[sn] in checklist:
        f[sn] = 1
if start == 0: print(0)
else:
    goof = [i for i in range(n) if f[i] == 1]
    left = goof[0]
    right = goof[-1]
    r_nagasa = len([i for i in range(len(goof)) if start <= i])
    l_nagasa = len(goof) - r_nagasa
    print(right-start+l_nagasa+1)
0