結果

問題 No.1943 消えたAGCT(1)
コンテスト
ユーザー siganai
提出日時 2022-05-20 21:52:32
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 68 ms / 2,000 ms
コード長 613 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 129 ms
コンパイル使用メモリ 84,864 KB
実行使用メモリ 75,520 KB
最終ジャッジ日時 2026-04-08 19:40:04
合計ジャッジ時間 2,762 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 27
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#!/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)
0