Submission #869939

# Submission time Handle Problem Language Result Execution time Memory
869939 2023-11-06T11:43:37 Z Matjaz Teams (CEOI11_tea) C++14
0 / 100
292 ms 15080 KB
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int main(){
    int N;
    cin >> N;
    vector<int> a(N);
    for (int i=0;i<N;i++) cin >> a[i];
    sort(a.begin(), a.end());
    
    vector<int> max_teams(N);
    if (a[0] == 1) max_teams[0] = 1; else max_teams[0] = 0;
    
    for (int i=1;i<N;i++){
        max_teams[i] = max_teams[i-1];
        if (i + 1 - a[i] == 0) max_teams[i] = max(max_teams[i], 1);
        if (i + 1 - a[i] > 0) max_teams[i] = max(max_teams[i], 1 + max_teams[i-a[i]]);
    }
    
    cout << max_teams[N-1] << endl;
    
    return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 356 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 708 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 600 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 20 ms 1364 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 21 ms 1616 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 161 ms 9808 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 237 ms 13928 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 292 ms 15080 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -