結果
問題 |
No.1632 Sorting Integers (GCD of M)
|
ユーザー |
![]() |
提出日時 | 2021-07-30 22:14:57 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 414 bytes |
コンパイル時間 | 414 ms |
コンパイル使用メモリ | 81,720 KB |
実行使用メモリ | 54,240 KB |
最終ジャッジ日時 | 2024-09-16 00:38:20 |
合計ジャッジ時間 | 4,925 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 29 WA * 30 |
ソースコード
MOD = 10 ** 9 + 7 n = int(input()) c = list(map(int, input().split())) for i in range(9): if c[i] == n: print((i + 1) * (pow(10, n, MOD) - 1) * pow(9, MOD - 2, MOD) % MOD) exit(0) s = 0 for i in range(9): s += (i + 1) * c[i] ans = 1 if c[0] + c[2] + c[4] + c[6] + c[8] == n: ans *= 2 if c[0] + c[5] == n: ans *= 5 if s % 9 == 0: ans *= 9 elif s % 3 == 0: ans *= 3 print(ans)