結果

問題 No.1943 消えたAGCT(1)
ユーザー siganaisiganai
提出日時 2022-05-20 21:52:32
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 95 ms / 2,000 ms
コード長 613 bytes
コンパイル時間 157 ms
コンパイル使用メモリ 81,556 KB
実行使用メモリ 74,228 KB
最終ジャッジ日時 2023-10-20 12:26:04
合計ジャッジ時間 3,241 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 56 ms
63,488 KB
testcase_01 AC 56 ms
63,488 KB
testcase_02 AC 56 ms
63,488 KB
testcase_03 AC 56 ms
63,488 KB
testcase_04 AC 56 ms
63,488 KB
testcase_05 AC 56 ms
63,488 KB
testcase_06 AC 56 ms
63,488 KB
testcase_07 AC 55 ms
63,488 KB
testcase_08 AC 56 ms
63,488 KB
testcase_09 AC 81 ms
73,584 KB
testcase_10 AC 67 ms
69,312 KB
testcase_11 AC 67 ms
69,312 KB
testcase_12 AC 76 ms
69,452 KB
testcase_13 AC 69 ms
68,860 KB
testcase_14 AC 68 ms
70,312 KB
testcase_15 AC 85 ms
73,484 KB
testcase_16 AC 78 ms
71,164 KB
testcase_17 AC 83 ms
73,280 KB
testcase_18 AC 86 ms
73,580 KB
testcase_19 AC 83 ms
73,580 KB
testcase_20 AC 83 ms
73,580 KB
testcase_21 AC 84 ms
73,580 KB
testcase_22 AC 95 ms
74,152 KB
testcase_23 AC 95 ms
74,228 KB
testcase_24 AC 69 ms
69,312 KB
testcase_25 AC 69 ms
69,312 KB
testcase_26 AC 69 ms
69,312 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env PyPy3

from collections import Counter, defaultdict, deque
import itertools
import re
import math
from functools import reduce
import operator
import bisect
from heapq import *
import functools
mod=998244353

import sys
input=sys.stdin.readline
n = int(input())
s = input().rstrip()
cnt = 0
for i in range(n):
    if s[i] == 'A' or s[i] == 'G' or s[i] == 'C' or s[i] == 'T':
        cnt += 1
ans = 0
now = cnt
while cnt:
    if s[now-1] == 'A' or s[now-1] == 'G' or s[now-1] == 'C' or s[now-1] == 'T':
        cnt -= 1
        now = cnt
    else:
        now = cnt + ans + 1
    ans += 1
print(ans)
0