結果
| 問題 |
No.462 6日知らずのコンピュータ
|
| コンテスト | |
| ユーザー |
compass19
|
| 提出日時 | 2016-12-13 00:32:20 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 638 bytes |
| コンパイル時間 | 207 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 10,880 KB |
| 最終ジャッジ日時 | 2024-11-29 23:01:29 |
| 合計ジャッジ時間 | 5,329 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 36 WA * 48 |
ソースコード
from functools import lru_cache @lru_cache(maxsize=None) def power(n): if n <= 1: return 1 else: return power(n-1)*n n, k = map(int, input().split()) if k == 0: print(power(n)); exit() a_list = list(map(int, input().split())) list_of_list = list() for m in a_list: tmp = list(map(int, bin(m)[2:])) tmp += [0]*(n-len(tmp)) list_of_list.append(tmp) list_of_list = sorted(list_of_list, key=lambda x: x.count(1)) num_power = 1 source = [0]*n for _list in list_of_list: count = 0 for i, j in zip(source, _list): if j-i < 0: print(0); exit() elif j-i == 1: count += 1 source = _list num_power *= power(count) print(num_power)
compass19