結果

問題 No.1943 消えたAGCT(1)
コンテスト
ユーザー pitP
提出日時 2022-05-20 23:54:44
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
WA  
実行時間 -
コード長 286 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 246 ms
コンパイル使用メモリ 85,180 KB
実行使用メモリ 102,900 KB
最終ジャッジ日時 2026-04-08 21:34:28
合計ジャッジ時間 2,296 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 17 WA * 10
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import bisect
n = int(input())
s = input()
idx = []
c = 0
for i in range(n):
    if s[i] in ["A","C","G","T"]:
        c += 1
        idx.append(i+1)

if c == 0:
    print(0)
    exit()

if c == idx[-1]:
    print(c)
elif c < idx[0]:
    print(idx[-1])
else:
    print(idx[-1]-idx[0]+1)
0