結果
| 問題 | No.1943 消えたAGCT(1) |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-08-03 12:55:17 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 290 bytes |
| 記録 | |
| コンパイル時間 | 286 ms |
| コンパイル使用メモリ | 85,524 KB |
| 実行使用メモリ | 102,044 KB |
| 最終ジャッジ日時 | 2026-04-03 19:52:29 |
| 合計ジャッジ時間 | 4,504 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge5_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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)