結果

問題 No.1943 消えたAGCT(1)
コンテスト
ユーザー terasa
提出日時 2022-05-21 18:53:14
言語 PyPy3
(7.3.23 + ACL)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
WA  
実行時間 -
コード長 557 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 252 ms
コンパイル使用メモリ 95,688 KB
実行使用メモリ 92,672 KB
最終ジャッジ日時 2026-08-31 19:03:08
合計ジャッジ時間 6,434 ms
ジャッジサーバーID
(参考情報)
judge3_1 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 17 WA * 10
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import sys
import pypyjit
import itertools
import heapq
import math
from collections import deque, defaultdict, Counter
import string
import random

input = sys.stdin.readline
sys.setrecursionlimit(10 ** 6)
pypyjit.set_param('max_unroll_recursion=-1')


N = int(input())
S = input()[:-1]

chars = {'A', 'G', 'C', 'T'}
cnt = 0
first = None
last = None
for i, c in enumerate(S):
    if c in chars:
        if first is None:
            first = i
        last = i
        cnt += 1
if first is None:
    print(0)
else:
    print(last - min(first, cnt - 1) + 1)
0