結果
| 問題 |
No.1943 消えたAGCT(1)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-08-03 12:55:17 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 290 bytes |
| コンパイル時間 | 449 ms |
| コンパイル使用メモリ | 82,104 KB |
| 実行使用メモリ | 104,092 KB |
| 最終ジャッジ日時 | 2024-08-03 12:55:23 |
| 合計ジャッジ時間 | 5,717 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 12 TLE * 1 -- * 14 |
ソースコード
N = int(input())
S = list(input())
cnt = 0
for i in range(N):
if S[i] in "AGCT":
cnt += 1
if cnt == 0:
print(0)
exit()
ans = 0
while True:
ans += 1
p = S.pop(cnt - 1)
if p in "AGCT":
cnt -= 1
if cnt == 0:
break
print(ans)