結果

問題 No.1943 消えたAGCT(1)
ユーザー ThetaTheta
提出日時 2022-11-02 16:19:26
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 52 ms / 2,000 ms
コード長 388 bytes
コンパイル時間 837 ms
コンパイル使用メモリ 10,692 KB
実行使用メモリ 9,552 KB
最終ジャッジ日時 2023-09-24 05:20:19
合計ジャッジ時間 3,063 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
8,552 KB
testcase_01 AC 15 ms
8,392 KB
testcase_02 AC 15 ms
8,448 KB
testcase_03 AC 15 ms
8,592 KB
testcase_04 AC 15 ms
8,544 KB
testcase_05 AC 15 ms
8,436 KB
testcase_06 AC 15 ms
8,556 KB
testcase_07 AC 14 ms
8,520 KB
testcase_08 AC 15 ms
8,404 KB
testcase_09 AC 46 ms
9,432 KB
testcase_10 AC 44 ms
9,384 KB
testcase_11 AC 45 ms
9,420 KB
testcase_12 AC 44 ms
9,520 KB
testcase_13 AC 33 ms
9,320 KB
testcase_14 AC 15 ms
8,480 KB
testcase_15 AC 47 ms
9,472 KB
testcase_16 AC 42 ms
9,296 KB
testcase_17 AC 44 ms
9,512 KB
testcase_18 AC 50 ms
9,388 KB
testcase_19 AC 48 ms
9,544 KB
testcase_20 AC 46 ms
9,492 KB
testcase_21 AC 49 ms
9,536 KB
testcase_22 AC 43 ms
9,416 KB
testcase_23 AC 45 ms
9,424 KB
testcase_24 AC 48 ms
9,472 KB
testcase_25 AC 51 ms
9,552 KB
testcase_26 AC 52 ms
9,472 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import Counter


def main():
    n = int(input())
    S = input()
    S_counter = Counter(S)

    a_idx = S.rfind("A")
    g_idx = S.rfind("G")
    c_idx = S.rfind("C")
    t_idx = S.rfind("T")
    most_far_idx = max(a_idx, g_idx, c_idx, t_idx)
    if most_far_idx == -1:
        print(0)
        return

    print(most_far_idx+1)


if __name__ == "__main__":
    main()
0