# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
101766 | SomeoneUnknown | Ice Hockey World Championship (CEOI15_bobek) | C++14 | 1083 ms | 384 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
long long n;
long long b;
long long tix[40];
long long ways(long long spent, int ontix){
if(spent > b) return 0;
if(ontix == n){
//printf("%lld\n", spent);
return 1;
}
return ways(spent, ontix+1) + ways(spent+tix[ontix], ontix+1);
}
int main(){
scanf("%lld %lld", &n, &b);
//printf("%lld", b);
for(int i = 0; i < n; i++){
scanf("%lld", &tix[i]);
}
printf("%lld", ways(0LL, 0));
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |