結果
| 問題 | No.1644 Eight Digits |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-12-18 16:48:50 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 681 bytes |
| 記録 | |
| コンパイル時間 | 367 ms |
| コンパイル使用メモリ | 82,184 KB |
| 実行使用メモリ | 86,292 KB |
| 最終ジャッジ日時 | 2025-12-18 16:48:56 |
| 合計ジャッジ時間 | 5,532 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 WA * 1 |
| other | AC * 2 WA * 20 TLE * 1 -- * 2 |
ソースコード
import sys
from itertools import count
from typing import List, Tuple
def int1(x: str, /): return int(x) - 1
def input(): return sys.stdin.readline().rstrip('\n')
def main():
k = int(input())
if k == 1 or k == 3:
return 8 * 7 * 6 * 5 * 4 * 3 * 2 * 1
if k == 2:
return 8 * 7 * 6 * 5 * 4 * 3 * 2 * 1 // 2
a = 0
for i in range(k, 87654321 + 1, k):
if sorted(str(i)) == '12345678':
a += 1
return a
def _start():
ret = main()
if ret is not None:
if isinstance(ret, List) or isinstance(ret, Tuple):
print(*ret)
else:
print(ret)
if __name__ == '__main__':
_start()