結果

問題 No.1943 消えたAGCT(1)
ユーザー AkariAkari
提出日時 2022-05-20 21:43:47
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 529 ms / 2,000 ms
コード長 340 bytes
コンパイル時間 374 ms
コンパイル使用メモリ 11,972 KB
実行使用メモリ 47,812 KB
最終ジャッジ日時 2023-10-20 12:10:42
合計ジャッジ時間 17,135 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 511 ms
42,608 KB
testcase_01 AC 467 ms
42,656 KB
testcase_02 AC 468 ms
42,656 KB
testcase_03 AC 468 ms
42,656 KB
testcase_04 AC 469 ms
42,656 KB
testcase_05 AC 466 ms
42,656 KB
testcase_06 AC 471 ms
42,656 KB
testcase_07 AC 469 ms
42,652 KB
testcase_08 AC 467 ms
42,656 KB
testcase_09 AC 529 ms
47,812 KB
testcase_10 AC 473 ms
43,532 KB
testcase_11 AC 470 ms
43,608 KB
testcase_12 AC 479 ms
44,716 KB
testcase_13 AC 471 ms
43,132 KB
testcase_14 AC 467 ms
42,656 KB
testcase_15 AC 478 ms
43,132 KB
testcase_16 AC 477 ms
43,132 KB
testcase_17 AC 480 ms
43,132 KB
testcase_18 AC 484 ms
43,608 KB
testcase_19 AC 490 ms
43,608 KB
testcase_20 AC 484 ms
43,608 KB
testcase_21 AC 488 ms
43,608 KB
testcase_22 AC 485 ms
46,312 KB
testcase_23 AC 481 ms
46,312 KB
testcase_24 AC 488 ms
43,608 KB
testcase_25 AC 481 ms
43,608 KB
testcase_26 AC 483 ms
43,628 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