結果
| 問題 |
No.1943 消えたAGCT(1)
|
| コンテスト | |
| ユーザー |
june19312
|
| 提出日時 | 2022-05-20 22:37:57 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 429 bytes |
| コンパイル時間 | 246 ms |
| コンパイル使用メモリ | 82,708 KB |
| 実行使用メモリ | 79,916 KB |
| 最終ジャッジ日時 | 2024-09-20 08:55:28 |
| 合計ジャッジ時間 | 4,562 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 12 TLE * 1 -- * 14 |
ソースコード
n = int(input())
s = input()
AGCT = ["A","G","C","T"]
tmp = [True]*(len(s))
cnt = 0
for i,v in enumerate(s):
if v in AGCT:
cnt+=1
ans = 0
while cnt>0:
tmp2 = cnt-1
flag = True
while flag:
if tmp[tmp2]:
tmp[tmp2]=False
if s[tmp2] in AGCT:
cnt-=1
ans+=1
flag = False
break
else:
tmp2+=1
print(ans)
june19312