結果

問題 No.1943 消えたAGCT(1)
コンテスト
ユーザー pitP
提出日時 2022-05-20 23:54:44
言語 PyPy3
(8.0.0 + ACL)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
WA  
実行時間 -
コード長 286 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 237 ms
コンパイル使用メモリ 95,952 KB
実行使用メモリ 120,832 KB
最終ジャッジ日時 2026-08-31 17:57:36
合計ジャッジ時間 4,386 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
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