結果
問題 | No.462 6日知らずのコンピュータ |
ユーザー | mkawa2 |
提出日時 | 2020-01-02 00:25:18 |
言語 | Python3 (3.12.2 + numpy 1.26.4 + scipy 1.12.0) |
結果 |
AC
|
実行時間 | 540 ms / 2,000 ms |
コード長 | 1,281 bytes |
コンパイル時間 | 132 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 44,768 KB |
最終ジャッジ日時 | 2024-11-22 17:33:34 |
合計ジャッジ時間 | 47,386 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 512 ms
44,504 KB |
testcase_01 | AC | 515 ms
44,508 KB |
testcase_02 | AC | 512 ms
44,392 KB |
testcase_03 | AC | 514 ms
44,520 KB |
testcase_04 | AC | 520 ms
44,504 KB |
testcase_05 | AC | 540 ms
44,508 KB |
testcase_06 | AC | 514 ms
44,392 KB |
testcase_07 | AC | 513 ms
44,380 KB |
testcase_08 | AC | 515 ms
44,508 KB |
testcase_09 | AC | 510 ms
44,388 KB |
testcase_10 | AC | 519 ms
44,640 KB |
testcase_11 | AC | 516 ms
44,648 KB |
testcase_12 | AC | 522 ms
44,260 KB |
testcase_13 | AC | 517 ms
44,640 KB |
testcase_14 | AC | 522 ms
44,388 KB |
testcase_15 | AC | 522 ms
44,392 KB |
testcase_16 | AC | 515 ms
44,252 KB |
testcase_17 | AC | 512 ms
44,396 KB |
testcase_18 | AC | 515 ms
44,640 KB |
testcase_19 | AC | 515 ms
44,396 KB |
testcase_20 | AC | 516 ms
44,252 KB |
testcase_21 | AC | 513 ms
44,648 KB |
testcase_22 | AC | 513 ms
44,516 KB |
testcase_23 | AC | 513 ms
44,644 KB |
testcase_24 | AC | 511 ms
44,392 KB |
testcase_25 | AC | 515 ms
44,520 KB |
testcase_26 | AC | 513 ms
44,508 KB |
testcase_27 | AC | 513 ms
44,644 KB |
testcase_28 | AC | 515 ms
44,640 KB |
testcase_29 | AC | 512 ms
44,648 KB |
testcase_30 | AC | 514 ms
44,384 KB |
testcase_31 | AC | 521 ms
44,508 KB |
testcase_32 | AC | 518 ms
44,248 KB |
testcase_33 | AC | 511 ms
44,636 KB |
testcase_34 | AC | 512 ms
44,512 KB |
testcase_35 | AC | 510 ms
44,376 KB |
testcase_36 | AC | 510 ms
44,640 KB |
testcase_37 | AC | 508 ms
44,648 KB |
testcase_38 | AC | 511 ms
44,636 KB |
testcase_39 | AC | 512 ms
44,508 KB |
testcase_40 | AC | 513 ms
44,520 KB |
testcase_41 | AC | 516 ms
44,764 KB |
testcase_42 | AC | 519 ms
44,652 KB |
testcase_43 | AC | 512 ms
44,632 KB |
testcase_44 | AC | 514 ms
44,380 KB |
testcase_45 | AC | 515 ms
44,648 KB |
testcase_46 | AC | 510 ms
44,516 KB |
testcase_47 | AC | 510 ms
44,512 KB |
testcase_48 | AC | 510 ms
44,508 KB |
testcase_49 | AC | 509 ms
44,648 KB |
testcase_50 | AC | 507 ms
44,400 KB |
testcase_51 | AC | 515 ms
44,764 KB |
testcase_52 | AC | 521 ms
44,640 KB |
testcase_53 | AC | 515 ms
44,520 KB |
testcase_54 | AC | 518 ms
44,504 KB |
testcase_55 | AC | 510 ms
44,508 KB |
testcase_56 | AC | 511 ms
44,388 KB |
testcase_57 | AC | 513 ms
44,268 KB |
testcase_58 | AC | 514 ms
44,528 KB |
testcase_59 | AC | 512 ms
44,396 KB |
testcase_60 | AC | 506 ms
44,384 KB |
testcase_61 | AC | 512 ms
44,388 KB |
testcase_62 | AC | 510 ms
44,252 KB |
testcase_63 | AC | 513 ms
44,764 KB |
testcase_64 | AC | 512 ms
44,768 KB |
testcase_65 | AC | 508 ms
44,508 KB |
testcase_66 | AC | 508 ms
44,384 KB |
testcase_67 | AC | 511 ms
44,640 KB |
testcase_68 | AC | 510 ms
44,764 KB |
testcase_69 | AC | 506 ms
44,636 KB |
testcase_70 | AC | 509 ms
44,636 KB |
testcase_71 | AC | 510 ms
44,504 KB |
testcase_72 | AC | 508 ms
44,512 KB |
testcase_73 | AC | 511 ms
44,252 KB |
testcase_74 | AC | 510 ms
44,248 KB |
testcase_75 | AC | 504 ms
44,396 KB |
testcase_76 | AC | 511 ms
44,640 KB |
testcase_77 | AC | 512 ms
44,520 KB |
testcase_78 | AC | 510 ms
44,504 KB |
testcase_79 | AC | 515 ms
44,504 KB |
testcase_80 | AC | 511 ms
44,520 KB |
testcase_81 | AC | 513 ms
44,648 KB |
testcase_82 | AC | 512 ms
44,632 KB |
testcase_83 | AC | 512 ms
44,760 KB |
testcase_84 | AC | 518 ms
44,396 KB |
testcase_85 | AC | 514 ms
44,256 KB |
testcase_86 | AC | 516 ms
44,648 KB |
ソースコード
from itertools import * from bisect import * from math import * from collections import * from heapq import * from random import * from decimal import * import numpy as np import sys sys.setrecursionlimit(10 ** 6) int1 = lambda x: int(x) - 1 p2D = lambda x: print(*x, sep="\n") def II(): return int(sys.stdin.readline()) def MI(): return map(int, sys.stdin.readline().split()) def MI1(): return map(int1, sys.stdin.readline().split()) def MF(): return map(float, sys.stdin.readline().split()) def LI(): return list(map(int, sys.stdin.readline().split())) def LI1(): return list(map(int1, sys.stdin.readline().split())) def LF(): return list(map(float, sys.stdin.readline().split())) def LLI(rows_number): return [LI() for _ in range(rows_number)] dij = [(1, 0), (0, 1), (-1, 0), (0, -1)] def main(): def popcnt(x): return bin(x).count('1') md=10**9+7 n,k=MI() if k==0: print(factorial(n)%md) exit() aa=LI() aa.sort() for a0,a1 in zip(aa[-2::-1],aa[::-1]): if a0!=a0&a1: print(0) exit() ans=1 pa=0 for a in aa: #print(format(a,'b').zfill(n)) ans*=factorial(popcnt(a)-popcnt(pa)) ans%=md pa=a ans*=factorial(n-popcnt(pa)) print(ans%md) main()