結果
問題 |
No.1943 消えたAGCT(1)
|
ユーザー |
![]() |
提出日時 | 2022-05-20 23:54:44 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 286 bytes |
コンパイル時間 | 197 ms |
コンパイル使用メモリ | 82,472 KB |
実行使用メモリ | 101,376 KB |
最終ジャッジ日時 | 2024-09-20 10:20:33 |
合計ジャッジ時間 | 2,683 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 17 WA * 10 |
ソースコード
import bisect n = int(input()) s = input() idx = [] c = 0 for i in range(n): if s[i] in ["A","C","G","T"]: c += 1 idx.append(i+1) if c == 0: print(0) exit() if c == idx[-1]: print(c) elif c < idx[0]: print(idx[-1]) else: print(idx[-1]-idx[0]+1)