Submission #681719

#TimeUsernameProblemLanguageResultExecution timeMemory
681719Doncho_BonbonchoIce Hockey World Championship (CEOI15_bobek)C++14
40 / 100
860 ms1048576 KiB
#include <bits/stdc++.h> typedef long long ll; typedef unsigned long long ull; typedef long double ld; const int MAX_N = 1e6; const int INF = 1e9; const int mod = 1e9 + 7; ll a[MAX_N]; std::vector<ll> v; int main () { std::ios_base::sync_with_stdio(false); std::cin.tie(NULL); ll n, m; std::cin>>n>>m; v.push_back(0LL); for( int i=0 ; i<n ; i++ ) std::cin>>a[i]; for( int i=0 ; i<n ; i++ ){ ll curr = a[i]; int sz = v.size(); for( int j=0 ; j<sz ; j++ ){ ll currS = v[j] + curr; // std::cerr<<v[j]<<" + "<<curr<<" = "<<currS<<" ? "<<m<<"\n"; if( currS <= m ){ // std::cerr<<" mina\n "; v.push_back( currS ); } } //if( curr < m ) v.push_back( curr ); } std::cout<<v.size()<<"\n"; return 0; }
#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...