結果

問題 No.1943 消えたAGCT(1)
ユーザー AkariAkari
提出日時 2022-05-20 21:43:47
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 513 ms / 2,000 ms
コード長 340 bytes
コンパイル時間 78 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 47,148 KB
最終ジャッジ日時 2024-09-20 07:41:51
合計ジャッジ時間 14,983 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 451 ms
43,652 KB
testcase_01 AC 461 ms
43,804 KB
testcase_02 AC 467 ms
43,804 KB
testcase_03 AC 467 ms
43,428 KB
testcase_04 AC 462 ms
43,656 KB
testcase_05 AC 475 ms
43,420 KB
testcase_06 AC 463 ms
43,800 KB
testcase_07 AC 467 ms
43,656 KB
testcase_08 AC 463 ms
43,676 KB
testcase_09 AC 513 ms
47,148 KB
testcase_10 AC 474 ms
43,924 KB
testcase_11 AC 480 ms
43,828 KB
testcase_12 AC 464 ms
44,216 KB
testcase_13 AC 462 ms
43,776 KB
testcase_14 AC 462 ms
43,792 KB
testcase_15 AC 460 ms
43,568 KB
testcase_16 AC 460 ms
43,396 KB
testcase_17 AC 463 ms
43,776 KB
testcase_18 AC 468 ms
43,952 KB
testcase_19 AC 475 ms
43,948 KB
testcase_20 AC 474 ms
44,088 KB
testcase_21 AC 473 ms
43,872 KB
testcase_22 AC 463 ms
45,740 KB
testcase_23 AC 464 ms
46,124 KB
testcase_24 AC 467 ms
43,828 KB
testcase_25 AC 460 ms
43,960 KB
testcase_26 AC 471 ms
43,688 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
import numpy as np


def main():
    buf = sys.stdin.buffer
    n = int(buf.readline())
    S = np.frombuffer(buf.readline().rstrip(), np.uint8)
    A = np.array([ord('A'), ord('C'), ord('G'), ord('T')])
    B = np.in1d(S, A)
    print(B.nonzero()[0][-1] + 1 if np.count_nonzero(B) else 0)


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