結果
| 問題 | No.2844 Birthday Party Decoration |
| ユーザー |
ニックネーム
|
| 提出日時 | 2024-08-23 21:45:18 |
| 言語 | Python3 (3.15.2 + numpy 2.5.4 + scipy 1.18.1 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 294 ms / 2,000 ms |
| + 535µs | |
| コード長 | 404 bytes |
| 記録 | |
| コンパイル時間 | 76 ms |
| コンパイル使用メモリ | 14,720 KB |
| 実行使用メモリ | 10,240 KB |
| 最終ジャッジ日時 | 2026-11-01 19:47:04 |
| 合計ジャッジ時間 | 2,659 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge7_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 5 |
ソースコード
for _ in range(int(input())):
n,x = map(int,input().split())
l = [x]; r = [x]; z = 1<<61
for v in map(int,input().split()):
if x>>v&1: l.append(v); r.append(v)
else: y = (1<<v)-1&x^x; l.append(y-1); r.append(y|1<<v)
for p in l:
if p<0: continue
q = x
for li,ri in zip(l,r):
if li<p: q = max(q,ri)
z = min(z,2*(q-p))
print(z)
ニックネーム