Submission #101766

#TimeUsernameProblemLanguageResultExecution timeMemory
101766SomeoneUnknownIce Hockey World Championship (CEOI15_bobek)C++14
40 / 100
1083 ms384 KiB
#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)

bobek.cpp: In function 'int main()':
bobek.cpp:19:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%lld %lld", &n, &b);
     ~~~~~^~~~~~~~~~~~~~~~~~~~~
bobek.cpp:22:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%lld", &tix[i]);
         ~~~~~^~~~~~~~~~~~~~~~~
#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...