結果
| 問題 |
No.412 花火大会
|
| コンテスト | |
| ユーザー |
はむ吉🐹
|
| 提出日時 | 2017-02-12 20:01:17 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 723 bytes |
| コンパイル時間 | 273 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 10,880 KB |
| 最終ジャッジ日時 | 2024-12-29 16:56:12 |
| 合計ジャッジ時間 | 2,055 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 14 WA * 4 |
ソースコード
#!/usr/bin/env python3
import bisect
import collections
def solve(bcd, es):
def p2(x):
return 1 << x
reqs = sorted(bcd)
s = collections.Counter(bisect.bisect(reqs, e) for e in es)
res = p2(s[0]) * (p2(s[1]) - 1) * (p2(s[2]) - 1) * (p2(s[3]) - 1)
res += p2(s[0]) * (p2(s[1]) - 1) * (p2(s[3]) - 1 - s[3])
res += p2(s[0]) * (p2(s[2]) - 1 - s[2]) * (p2(s[3]) - 1)
res += p2(s[0]) * (p2(s[2]) - 1) * (p2(s[3]) - 1 - s[3])
res += p2(s[0]) * (p2(s[3]) - 1 - s[3] - s[3] * (s[3] - 1) // 2)
return res
def main():
bcd = (int(x) for x in input().split())
_ = input()
es = (int(x) for x in input().split())
print(solve(bcd, es))
if __name__ == '__main__':
main()
はむ吉🐹