제출 #1121509

#제출 시각아이디문제언어결과실행 시간메모리
1121509vjudge1Ice Hockey World Championship (CEOI15_bobek)C++17
40 / 100
64 ms508 KiB
#include <bits/stdc++.h> using namespace std; #define int long long const int sz=2e5+5; const int INF=1e18; const int MOD=1e9+7; int arr[sz]; void solve() { int n,m; cin>>n>>m; for(int i=0;i<n;i++) cin>>arr[i]; int res=0; for(int mask=0;mask<(1<<n);mask++) { int cur_money=0; for(int i=0;i<n;i++) if(mask&(1<<i)) cur_money+=arr[i]; if(cur_money<=m) res++; } cout<<res; } signed main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int t=1; //cin>>t; while(t--) { solve(); } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...