結果

問題 No.2593 Reorder and Mod 120
ユーザー ニックネームニックネーム
提出日時 2023-12-25 18:05:38
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 267 bytes
コンパイル時間 137 ms
コンパイル使用メモリ 11,776 KB
実行使用メモリ 10,496 KB
最終ジャッジ日時 2023-12-25 18:05:40
合計ジャッジ時間 2,441 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 51 ms
9,984 KB
testcase_01 AC 30 ms
9,984 KB
testcase_02 AC 53 ms
9,984 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 32 ms
9,984 KB
testcase_06 AC 53 ms
9,984 KB
testcase_07 AC 30 ms
9,984 KB
testcase_08 AC 33 ms
9,984 KB
testcase_09 AC 30 ms
9,984 KB
testcase_10 AC 30 ms
9,984 KB
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
testcase_18 RE -
testcase_19 RE -
testcase_20 RE -
testcase_21 RE -
testcase_22 RE -
testcase_23 RE -
testcase_24 RE -
testcase_25 RE -
testcase_26 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import Counter
from itertools import product
n = int(input()); s = input()
c = Counter(s); r = int(s)%3; x = set()
for i in product("123456789",repeat=min(n,4)):
    i = "".join(i)
    if Counter(i)<=c and int(i)%3==r: x.add(int(i)%120)
print(len(x))
0