結果
問題 | No.1943 消えたAGCT(1) |
ユーザー |
![]() |
提出日時 | 2022-05-20 23:36:22 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 129 ms / 2,000 ms |
コード長 | 467 bytes |
コンパイル時間 | 157 ms |
コンパイル使用メモリ | 82,176 KB |
実行使用メモリ | 135,056 KB |
最終ジャッジ日時 | 2024-09-20 10:02:44 |
合計ジャッジ時間 | 3,309 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 27 |
ソースコード
n = int(input())s = list(input())counter = 0start = s.count('A') + s.count('G') + s.count('C') + s.count('T')checklist = ['A','G','C','T']f = [0]*nfor sn in range(n):if s[sn] in checklist:f[sn] = 1if 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_nagasaprint(right-start+l_nagasa+1)