Submission #968014

# Submission time Handle Problem Language Result Execution time Memory
968014 2024-04-23T06:55:13 Z vjudge1 Ice Hockey World Championship (CEOI15_bobek) C++17
40 / 100
1000 ms 456 KB
#include <bits/stdc++.h>
using namespace std;
#define ll long long
ll n,m;
ll solve(vector<ll> pr,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(pr,curr-pr[i],i);
        }
    }
    return c;
}
int main() {
    cin.tie(0)->sync_with_stdio(false);
    cin >> n >> m;
    vector<ll> pr(n);
    for (int i=0;i<n;i++) {
        cin >> pr[i];
    }
    sort(pr.begin(),pr.end());
    while (pr.back() > m) {
        pr.pop_back();
        n--;
    }
    cout << solve(pr,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 0 ms 348 KB Output is correct
3 Correct 0 ms 344 KB Output is correct
4 Correct 0 ms 348 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 2 ms 348 KB Output is correct
2 Correct 2 ms 452 KB Output is correct
3 Correct 2 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 22 ms 456 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 22 ms 344 KB Output is correct
2 Correct 2 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 9 ms 348 KB Output is correct
6 Correct 3 ms 344 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Execution timed out 1070 ms 348 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1060 ms 348 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1020 ms 344 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1029 ms 348 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1044 ms 348 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1055 ms 348 KB Time limit exceeded
2 Halted 0 ms 0 KB -