結果
問題 | No.1943 消えたAGCT(1) |
ユーザー |
![]() |
提出日時 | 2022-05-21 00:08:34 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 119 ms / 2,000 ms |
コード長 | 493 bytes |
コンパイル時間 | 505 ms |
コンパイル使用メモリ | 82,304 KB |
実行使用メモリ | 77,568 KB |
最終ジャッジ日時 | 2024-09-20 10:33:10 |
合計ジャッジ時間 | 3,381 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 27 |
ソースコード
n = int(input()) s = "#" + input() c = 0 for i in range(n+1): if s[i] in ["A","C","G","T"]: c += 1 if c == 0: print(0) exit() idx = c ans = 0 while c: if s[idx] not in ["A","C","G","T"]: idx += 1 ans += 1 else: idx += 1 c -= 1 ans += 1 while c: if s[c] not in ["A","C","G","T"]: ans += 1 break else: c -= 1 ans += 1 print(ans)