結果

問題 No.462 6日知らずのコンピュータ
ユーザー _____TAB__________TAB_____
提出日時 2017-03-08 13:17:23
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 408 bytes
コンパイル時間 118 ms
コンパイル使用メモリ 10,804 KB
実行使用メモリ 8,212 KB
最終ジャッジ日時 2023-09-05 23:42:13
合計ジャッジ時間 5,327 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 18 ms
8,180 KB
testcase_01 AC 18 ms
8,184 KB
testcase_02 AC 17 ms
7,804 KB
testcase_03 AC 17 ms
7,724 KB
testcase_04 AC 17 ms
7,884 KB
testcase_05 AC 16 ms
7,752 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 16 ms
7,816 KB
testcase_09 AC 16 ms
7,736 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 17 ms
7,804 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 17 ms
7,732 KB
testcase_23 AC 16 ms
7,736 KB
testcase_24 AC 16 ms
7,864 KB
testcase_25 AC 16 ms
7,888 KB
testcase_26 AC 17 ms
7,736 KB
testcase_27 WA -
testcase_28 AC 17 ms
7,812 KB
testcase_29 AC 17 ms
7,872 KB
testcase_30 AC 16 ms
7,808 KB
testcase_31 AC 17 ms
7,860 KB
testcase_32 WA -
testcase_33 AC 16 ms
7,720 KB
testcase_34 WA -
testcase_35 AC 16 ms
7,860 KB
testcase_36 AC 16 ms
7,768 KB
testcase_37 WA -
testcase_38 AC 16 ms
7,812 KB
testcase_39 WA -
testcase_40 AC 16 ms
7,780 KB
testcase_41 AC 17 ms
7,888 KB
testcase_42 WA -
testcase_43 WA -
testcase_44 AC 16 ms
7,736 KB
testcase_45 AC 16 ms
7,872 KB
testcase_46 AC 16 ms
7,728 KB
testcase_47 AC 16 ms
7,776 KB
testcase_48 WA -
testcase_49 AC 16 ms
8,128 KB
testcase_50 AC 16 ms
8,184 KB
testcase_51 AC 16 ms
8,104 KB
testcase_52 AC 16 ms
8,148 KB
testcase_53 AC 16 ms
8,172 KB
testcase_54 AC 15 ms
8,188 KB
testcase_55 AC 16 ms
8,196 KB
testcase_56 AC 16 ms
8,200 KB
testcase_57 AC 16 ms
8,060 KB
testcase_58 AC 16 ms
8,140 KB
testcase_59 AC 16 ms
8,180 KB
testcase_60 AC 16 ms
8,132 KB
testcase_61 AC 16 ms
8,164 KB
testcase_62 WA -
testcase_63 AC 16 ms
8,208 KB
testcase_64 AC 16 ms
8,100 KB
testcase_65 AC 16 ms
8,180 KB
testcase_66 AC 15 ms
8,068 KB
testcase_67 AC 16 ms
8,136 KB
testcase_68 AC 16 ms
8,176 KB
testcase_69 AC 16 ms
8,180 KB
testcase_70 AC 16 ms
8,212 KB
testcase_71 AC 16 ms
8,176 KB
testcase_72 AC 16 ms
8,200 KB
testcase_73 AC 16 ms
8,028 KB
testcase_74 AC 16 ms
8,020 KB
testcase_75 AC 16 ms
8,036 KB
testcase_76 AC 16 ms
8,044 KB
testcase_77 AC 16 ms
8,024 KB
testcase_78 AC 15 ms
8,052 KB
testcase_79 AC 16 ms
7,868 KB
testcase_80 AC 16 ms
7,888 KB
testcase_81 AC 16 ms
7,720 KB
testcase_82 AC 16 ms
7,876 KB
testcase_83 AC 16 ms
7,788 KB
testcase_84 AC 16 ms
7,804 KB
testcase_85 AC 16 ms
8,160 KB
testcase_86 AC 16 ms
7,884 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, k = map(int, input().split())
B = [0]*N
ans = 1
mod = 10**9+7
if k:
	A = [int(i) for i in input().split()]
	A.sort()
	A = [bin(a)[:1:-1] for a in A]
	for a in A:
		n = 0
		for i, l in enumerate(a):
			if l == "1" and not B[i]:
				n += 1
				ans *= n
				ans %= mod
				B[i] = 1
			elif l == "0" and B[i]:
				print(0)
				exit()
	print(ans)
else:
	for i in range(N):
		ans *= i+1
		ans %= mod
	print(ans)
0