結果
| 問題 |
No.2784 繰り上がりなし十進和
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-06-14 22:06:55 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 618 bytes |
| コンパイル時間 | 397 ms |
| コンパイル使用メモリ | 82,152 KB |
| 実行使用メモリ | 198,184 KB |
| 最終ジャッジ日時 | 2024-06-14 22:07:33 |
| 合計ジャッジ時間 | 31,504 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 28 WA * 8 |
ソースコード
from itertools import product
A = [input() for i in range(6)]
AA = [list(map(int, list(a))) for a in A]
canvisit = set()
def f(a1, a2, a3, a4, a5, a6):
now = [0] * 6
if a1 == 0 and a2 == 0 and a3 == 0 and a4 == 0 and a5 == 0 and a6 == 0:
return -1
for i in range(6):
now[i] = AA[0][i] * a1 + AA[1][i] * a2 + AA[2][i] * a3 + AA[3][i] * a4 + AA[4][i] * a5 + AA[5][i] * a6
now[i] %= 10
return ''.join(map(str, now))
for a1, a2, a3, a4, a5, a6 in product(range(10), repeat=6):
now = f(a1, a2, a3, a4, a5, a6)
if now != -1:
canvisit.add(now)
print(len(canvisit))