提出 #43830564


ソースコード 拡げる

#!/usr/bin/env python3
from typing import *


def solve(N: int, S: str) -> int:
    include_A = False
    include_B = False
    include_C = False

    for index in range(N):
        char = S[index]
        if char == 'A':
            include_A = True
        elif char == 'B':
            include_B = True
        elif char == 'C':
            include_C = True

        if all([include_A, include_B, include_C]):
            return index+1


# generated by oj-template v4.8.1 (https://github.com/online-judge-tools/template-generator)
def main():
    N = int(input())
    S = input()
    a = solve(N, S)
    print(a)


if __name__ == '__main__':
    main()

提出情報

提出日時
問題 A - First ABC
ユーザ maureen
言語 Python (3.8.2)
得点 100
コード長 657 Byte
結果 AC
実行時間 33 ms
メモリ 9984 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 100 / 100
結果
AC × 3
AC × 13
セット名 テストケース
Sample 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt
All 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 01_random_1_00.txt, 01_random_1_01.txt, 01_random_1_02.txt, 02_random_2_00.txt, 02_random_2_01.txt, 02_random_2_02.txt, 03_min_00.txt, 03_min_01.txt, 03_min_02.txt, 04_corner_00.txt
ケース名 結果 実行時間 メモリ
00_sample_00.txt AC 32 ms 9896 KiB
00_sample_01.txt AC 26 ms 9780 KiB
00_sample_02.txt AC 31 ms 9948 KiB
01_random_1_00.txt AC 29 ms 9796 KiB
01_random_1_01.txt AC 30 ms 9780 KiB
01_random_1_02.txt AC 29 ms 9792 KiB
02_random_2_00.txt AC 31 ms 9892 KiB
02_random_2_01.txt AC 29 ms 9972 KiB
02_random_2_02.txt AC 25 ms 9944 KiB
03_min_00.txt AC 30 ms 9948 KiB
03_min_01.txt AC 28 ms 9896 KiB
03_min_02.txt AC 33 ms 9968 KiB
04_corner_00.txt AC 31 ms 9984 KiB