結果

問題 No.2593 Reorder and Mod 120
ユーザー rlangevinrlangevin
提出日時 2023-12-21 08:53:59
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 87 ms / 2,000 ms
コード長 414 bytes
コンパイル時間 171 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 76,060 KB
最終ジャッジ日時 2023-12-21 08:54:02
合計ジャッジ時間 2,977 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 56 ms
66,208 KB
testcase_01 AC 40 ms
53,460 KB
testcase_02 AC 53 ms
66,208 KB
testcase_03 AC 56 ms
66,212 KB
testcase_04 AC 57 ms
66,212 KB
testcase_05 AC 53 ms
66,208 KB
testcase_06 AC 56 ms
66,216 KB
testcase_07 AC 43 ms
53,460 KB
testcase_08 AC 38 ms
53,460 KB
testcase_09 AC 38 ms
53,460 KB
testcase_10 AC 39 ms
53,460 KB
testcase_11 AC 61 ms
68,416 KB
testcase_12 AC 87 ms
70,480 KB
testcase_13 AC 75 ms
76,032 KB
testcase_14 AC 65 ms
72,896 KB
testcase_15 AC 75 ms
75,948 KB
testcase_16 AC 61 ms
70,480 KB
testcase_17 AC 63 ms
72,512 KB
testcase_18 AC 64 ms
72,512 KB
testcase_19 AC 76 ms
76,012 KB
testcase_20 AC 82 ms
76,060 KB
testcase_21 AC 79 ms
76,060 KB
testcase_22 AC 77 ms
76,060 KB
testcase_23 AC 79 ms
76,060 KB
testcase_24 AC 72 ms
76,060 KB
testcase_25 AC 73 ms
76,060 KB
testcase_26 AC 74 ms
76,060 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import *

N = int(input())
S = input()
if N == 1:
    print(1)
elif N == 2:
    print(len(set(S)))
else:
    C = Counter(S)
    ans = [0] * 40

    def check(C, i):
        temp = Counter(str(i))
        for k, v in temp.items():
            if v > C[k]:
                return 0
        return 1

    for i in range(111,1000):
        if check(C, i):
            ans[i%40] = 1
    print(sum(ans))
0