結果

問題 No.2329 Nafmo、イカサマをする
コンテスト
ユーザー pあり
提出日時 2023-05-28 15:05:42
言語 PyPy3
(8.0.0 + ACL)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
WA  
実行時間 -
コード長 491 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 62 ms
コンパイル使用メモリ 82,156 KB
実行使用メモリ 116,112 KB
最終ジャッジ日時 2026-10-08 12:16:05
合計ジャッジ時間 4,810 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 14 WA * 26
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

from collections import deque
import bisect
import heapq

n,m,k = map(int, input().split())
n+=1


a = list(map(int, input().split()))
a.append(0)

sum3 = set()

for i1 in range(n):
  now1 = a[i1]
  for i2 in range(n):
    now2 = now1+a[i2]
    for i3 in range(n):
      sum3.add(now2+a[i3])
      
sum3 = list(sum3)
sum3.sort() 

bisect.bisect(a,55)
ans = 0

for a in sum3:
  b = m-a
  i = bisect.bisect(sum3,b)-1
  now = a+sum3[i]
  
  if(now<=m):
    ans = max(ans, now)
print(ans)
  
  
0