Submission #965654

# Submission time Handle Problem Language Result Execution time Memory
965654 2024-04-19T03:41:50 Z 12345678 Let's Win the Election (JOI22_ho_t3) C++17
10 / 100
25 ms 856 KB
#include <bits/stdc++.h>

using namespace std;

const int nx=505;

#define int long double

int n, k;
vector<pair<int, int>> v;
int cost, res=LDBL_MAX;

int32_t main()
{
    cin.tie(NULL)->sync_with_stdio(false);
    cin>>n>>k;
    v.resize(n);
    for (int i=0; i<n; i++) 
    {
        cin>>v[i].second>>v[i].first;
        if (v[i].first==-1) v[i].first=1e9;
    }
    sort(v.begin(), v.end());
    for (int i=0; i<k; i++)
    {
        vector<int> t;
        for (int j=i; j<n; j++) t.push_back(v[j].second);
        sort(t.begin(), t.end());
        int tmp=cost;
        //cout<<tmp<<'\n';
        for (int j=0; j<k-i; j++) tmp+=(t[j])/(1+i);
        //cout<<i<<' '<<tmp<<'\n';
        res=min(res, tmp);
        cost+=(v[i].first)/(1+i);
    }
    cout<<fixed<<setprecision(12)<<res;
}
# 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 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 4 ms 504 KB Output is correct
6 Correct 9 ms 348 KB Output is correct
7 Correct 15 ms 496 KB Output is correct
8 Correct 19 ms 348 KB Output is correct
9 Correct 20 ms 348 KB Output is correct
10 Correct 18 ms 348 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 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 4 ms 504 KB Output is correct
6 Correct 9 ms 348 KB Output is correct
7 Correct 15 ms 496 KB Output is correct
8 Correct 19 ms 348 KB Output is correct
9 Correct 20 ms 348 KB Output is correct
10 Correct 18 ms 348 KB Output is correct
11 Correct 1 ms 348 KB Output is correct
12 Correct 10 ms 492 KB Output is correct
13 Correct 12 ms 500 KB Output is correct
14 Correct 12 ms 348 KB Output is correct
15 Correct 18 ms 600 KB Output is correct
16 Correct 20 ms 492 KB Output is correct
17 Correct 20 ms 600 KB Output is correct
18 Correct 20 ms 456 KB Output is correct
19 Correct 22 ms 600 KB Output is correct
20 Correct 21 ms 344 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 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 1 ms 344 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 1 ms 348 KB Output is correct
8 Correct 1 ms 348 KB Output is correct
9 Incorrect 0 ms 348 KB Output isn't correct
10 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 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 1 ms 344 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 1 ms 348 KB Output is correct
8 Correct 1 ms 348 KB Output is correct
9 Incorrect 0 ms 348 KB Output isn't correct
10 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 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 1 ms 344 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 1 ms 348 KB Output is correct
8 Correct 1 ms 348 KB Output is correct
9 Incorrect 0 ms 348 KB Output isn't correct
10 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 25 ms 856 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 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 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 4 ms 504 KB Output is correct
6 Correct 9 ms 348 KB Output is correct
7 Correct 15 ms 496 KB Output is correct
8 Correct 19 ms 348 KB Output is correct
9 Correct 20 ms 348 KB Output is correct
10 Correct 18 ms 348 KB Output is correct
11 Correct 1 ms 348 KB Output is correct
12 Correct 10 ms 492 KB Output is correct
13 Correct 12 ms 500 KB Output is correct
14 Correct 12 ms 348 KB Output is correct
15 Correct 18 ms 600 KB Output is correct
16 Correct 20 ms 492 KB Output is correct
17 Correct 20 ms 600 KB Output is correct
18 Correct 20 ms 456 KB Output is correct
19 Correct 22 ms 600 KB Output is correct
20 Correct 21 ms 344 KB Output is correct
21 Correct 0 ms 344 KB Output is correct
22 Correct 1 ms 348 KB Output is correct
23 Correct 0 ms 348 KB Output is correct
24 Correct 0 ms 348 KB Output is correct
25 Correct 1 ms 344 KB Output is correct
26 Correct 0 ms 348 KB Output is correct
27 Correct 1 ms 348 KB Output is correct
28 Correct 1 ms 348 KB Output is correct
29 Incorrect 0 ms 348 KB Output isn't correct
30 Halted 0 ms 0 KB -