結果

問題 No.2593 Reorder and Mod 120
ユーザー ああいいああいい
提出日時 2023-12-23 17:33:48
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 641 bytes
コンパイル時間 366 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 74,504 KB
最終ジャッジ日時 2023-12-23 17:33:51
合計ジャッジ時間 2,599 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
53,460 KB
testcase_01 WA -
testcase_02 AC 41 ms
59,500 KB
testcase_03 AC 40 ms
59,500 KB
testcase_04 AC 41 ms
59,500 KB
testcase_05 AC 37 ms
53,460 KB
testcase_06 AC 41 ms
59,500 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 47 ms
62,356 KB
testcase_12 AC 48 ms
62,340 KB
testcase_13 AC 52 ms
73,580 KB
testcase_14 AC 49 ms
66,444 KB
testcase_15 AC 51 ms
70,808 KB
testcase_16 AC 47 ms
62,344 KB
testcase_17 AC 49 ms
66,464 KB
testcase_18 AC 48 ms
66,476 KB
testcase_19 AC 54 ms
72,916 KB
testcase_20 AC 56 ms
74,504 KB
testcase_21 AC 55 ms
74,504 KB
testcase_22 AC 54 ms
74,504 KB
testcase_23 AC 55 ms
74,504 KB
testcase_24 AC 45 ms
60,084 KB
testcase_25 AC 45 ms
60,084 KB
testcase_26 AC 45 ms
60,084 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
S = input()
dat = [0] * 10
for s in S:
    dat[int(s)] += 1
ans = set()

t = 0

for i in range(1,10):
    if dat[i]:
        dat[i] -= 1
    else:
        continue
    for j in range(1,10):
        if dat[j]:
            dat[j] -= 1
        else:
            continue
        for k in range(1,10):
            if dat[k]:
                dat[k] -= 1
            else:
                continue

            t = i + 10 * j + 100 * k
            for u in range(1,10):
                t += u * dat[u] * 40
            ans.add(t % 120)

            dat[k] += 1
        dat[j] += 1
    dat[i] += 1
print(len(ans))
                
0