Submission #792372

# Submission time Handle Problem Language Result Execution time Memory
792372 2023-07-25T03:46:14 Z MON Job Scheduling (CEOI12_jobs) C++14
55 / 100
100 ms 17112 KB
#include<iostream>
#include<cmath>
#include<vector>
using namespace std;

constexpr int NMAX = 1e5 + 1;

vector<int> t[NMAX];

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr),cout.tie(nullptr);

    int n,d,m,ti; cin >> n >> d >> m;
    for(int i = 1; i <= m ; i++)
        {
            cin >> ti;
            int id = min(n,ti + d);
            t[id].emplace_back(i);
        }

    int ans = 0,sp = 0;
    for(int i = 1; i <= n ; i++)
        {
            sp += t[i].size();
            ans = max(ans,(int)ceil(1.0 * sp / i));
        }

    cout << ans << '\n'; vector<int> v;
    for(int i = 1; i <= n ; i++)
        for(auto &it : t[i]) v.emplace_back(it);

    int now = 0; for(int i = 1; i <= n ; i++)
    {
        for(int j = 1; j <= ans ; j++)
            {
                if(now >= m) break;
                cout << v[now++] << " ";
            }

        cout << "0\n";
    }
}
# Verdict Execution time Memory Grader output
1 Incorrect 12 ms 4184 KB Output isn't correct
2 Incorrect 12 ms 4120 KB Output isn't correct
3 Incorrect 12 ms 4184 KB Output isn't correct
4 Incorrect 12 ms 4188 KB Output isn't correct
5 Incorrect 12 ms 4216 KB Output isn't correct
6 Incorrect 12 ms 4136 KB Output isn't correct
7 Incorrect 12 ms 4184 KB Output isn't correct
8 Incorrect 12 ms 4148 KB Output isn't correct
9 Correct 14 ms 4556 KB Output is correct
10 Correct 14 ms 4584 KB Output is correct
11 Correct 12 ms 4300 KB Output is correct
12 Correct 24 ms 5836 KB Output is correct
13 Correct 36 ms 8208 KB Output is correct
14 Correct 71 ms 9616 KB Output is correct
15 Incorrect 58 ms 11204 KB Output isn't correct
16 Correct 87 ms 13144 KB Output is correct
17 Correct 99 ms 15492 KB Output is correct
18 Correct 90 ms 15952 KB Output is correct
19 Correct 100 ms 17112 KB Output is correct
20 Correct 96 ms 15432 KB Output is correct