結果
| 問題 |
No.1943 消えたAGCT(1)
|
| コンテスト | |
| ユーザー |
terasa
|
| 提出日時 | 2022-05-21 18:53:14 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 557 bytes |
| コンパイル時間 | 212 ms |
| コンパイル使用メモリ | 82,176 KB |
| 実行使用メモリ | 79,104 KB |
| 最終ジャッジ日時 | 2024-09-20 12:03:53 |
| 合計ジャッジ時間 | 3,535 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 17 WA * 10 |
ソースコード
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)
terasa