結果
| 問題 |
No.1943 消えたAGCT(1)
|
| コンテスト | |
| ユーザー |
siganai
|
| 提出日時 | 2022-05-20 21:52:32 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 95 ms / 2,000 ms |
| コード長 | 613 bytes |
| コンパイル時間 | 171 ms |
| コンパイル使用メモリ | 82,040 KB |
| 実行使用メモリ | 75,136 KB |
| 最終ジャッジ日時 | 2024-09-20 07:56:24 |
| 合計ジャッジ時間 | 3,125 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 27 |
ソースコード
#!/usr/bin/env PyPy3
from collections import Counter, defaultdict, deque
import itertools
import re
import math
from functools import reduce
import operator
import bisect
from heapq import *
import functools
mod=998244353
import sys
input=sys.stdin.readline
n = int(input())
s = input().rstrip()
cnt = 0
for i in range(n):
if s[i] == 'A' or s[i] == 'G' or s[i] == 'C' or s[i] == 'T':
cnt += 1
ans = 0
now = cnt
while cnt:
if s[now-1] == 'A' or s[now-1] == 'G' or s[now-1] == 'C' or s[now-1] == 'T':
cnt -= 1
now = cnt
else:
now = cnt + ans + 1
ans += 1
print(ans)
siganai