Submission #968103

# Submission time Handle Problem Language Result Execution time Memory
968103 2024-04-23T07:41:40 Z vjudge1 Ice Hockey World Championship (CEOI15_bobek) C++17
40 / 100
1000 ms 600 KB
#include <bits/stdc++.h>
using namespace std;
#define ll long long
ll n,m;
ll pr[41];
ll solve(ll curr,ll pos) {
    if (curr == 0) {
        return 1;
    }
    ll c=1;
    for (int i=pos+1;i<n;i++) {
        if (curr-pr[i] >= 0) {
            c+=solve(curr-pr[i],i);
        } else {
            return c;
        }
    }
    return c;
}
int main() {
    cin.tie(0)->sync_with_stdio(false);
    cin >> n >> m;
    for (int i=0;i<n;i++) {
        cin >> pr[i];
        if (pr[i] > m) {
            i--;
            n--;
        }
    }
    sort(pr,pr+n);
    cout << solve(m,-1);
    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 0 ms 344 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 4 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 4 ms 348 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 2 ms 348 KB Output is correct
6 Correct 1 ms 600 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Execution timed out 1072 ms 348 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1046 ms 348 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1062 ms 348 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1053 ms 348 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1059 ms 348 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1037 ms 344 KB Time limit exceeded
2 Halted 0 ms 0 KB -