結果

問題 No.1943 消えたAGCT(1)
ユーザー terasaterasa
提出日時 2022-05-21 18:53:14
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 557 bytes
コンパイル時間 192 ms
コンパイル使用メモリ 81,848 KB
実行使用メモリ 78,640 KB
最終ジャッジ日時 2023-10-20 16:31:35
合計ジャッジ時間 3,343 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 56 ms
66,332 KB
testcase_01 AC 55 ms
66,332 KB
testcase_02 AC 60 ms
66,332 KB
testcase_03 AC 56 ms
66,332 KB
testcase_04 AC 59 ms
66,332 KB
testcase_05 AC 61 ms
66,332 KB
testcase_06 AC 57 ms
66,332 KB
testcase_07 AC 57 ms
66,332 KB
testcase_08 AC 56 ms
66,332 KB
testcase_09 AC 80 ms
78,536 KB
testcase_10 AC 69 ms
70,192 KB
testcase_11 AC 78 ms
78,532 KB
testcase_12 AC 65 ms
70,192 KB
testcase_13 AC 73 ms
77,944 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 88 ms
78,540 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 85 ms
78,640 KB
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 81 ms
78,532 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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