Submission #218778

# Submission time Handle Problem Language Result Execution time Memory
218778 2020-04-02T17:44:01 Z gratus907 None (KOI16_room) C++17
100 / 100
6 ms 512 KB
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define all(x) ((x).begin()),((x).end())
#define usecppio ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);

int a, b, c, d, e;
int n, k;
int need(int x)
{
    return (x/k)+1-(x%k==0);
}
int main()
{
    cin >> n >> k;
    for (int i = 0; i<n; i++)
    {
        int s, y;
        cin >> s >> y;
        if (y <= 2)
            a++;
        else if (y <= 4)
            s?b++:c++;
        else s?d++:e++;
    }
    cout << need(a)+need(b)+need(c)+need(d)+need(e) << '\n';
}
# Verdict Execution time Memory Grader output
1 Correct 5 ms 256 KB Output is correct
2 Correct 4 ms 256 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 256 KB Output is correct
2 Correct 5 ms 372 KB Output is correct
3 Correct 4 ms 256 KB Output is correct
4 Correct 5 ms 256 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 256 KB Output is correct
2 Correct 5 ms 384 KB Output is correct
3 Correct 5 ms 384 KB Output is correct
4 Correct 5 ms 256 KB Output is correct
5 Correct 5 ms 256 KB Output is correct
6 Correct 5 ms 256 KB Output is correct
7 Correct 5 ms 256 KB Output is correct
8 Correct 5 ms 384 KB Output is correct
9 Correct 5 ms 256 KB Output is correct
10 Correct 5 ms 256 KB Output is correct
11 Correct 5 ms 384 KB Output is correct
12 Correct 5 ms 256 KB Output is correct
13 Correct 4 ms 384 KB Output is correct
14 Correct 4 ms 384 KB Output is correct
15 Correct 5 ms 256 KB Output is correct
16 Correct 5 ms 384 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 256 KB Output is correct
2 Correct 4 ms 256 KB Output is correct
3 Correct 5 ms 256 KB Output is correct
4 Correct 5 ms 372 KB Output is correct
5 Correct 4 ms 256 KB Output is correct
6 Correct 5 ms 256 KB Output is correct
7 Correct 5 ms 256 KB Output is correct
8 Correct 5 ms 384 KB Output is correct
9 Correct 5 ms 384 KB Output is correct
10 Correct 5 ms 256 KB Output is correct
11 Correct 5 ms 256 KB Output is correct
12 Correct 5 ms 256 KB Output is correct
13 Correct 5 ms 256 KB Output is correct
14 Correct 5 ms 384 KB Output is correct
15 Correct 5 ms 256 KB Output is correct
16 Correct 5 ms 256 KB Output is correct
17 Correct 5 ms 384 KB Output is correct
18 Correct 5 ms 256 KB Output is correct
19 Correct 4 ms 384 KB Output is correct
20 Correct 4 ms 384 KB Output is correct
21 Correct 5 ms 256 KB Output is correct
22 Correct 5 ms 384 KB Output is correct
23 Correct 5 ms 256 KB Output is correct
24 Correct 5 ms 256 KB Output is correct
25 Correct 5 ms 256 KB Output is correct
26 Correct 6 ms 256 KB Output is correct
27 Correct 5 ms 256 KB Output is correct
28 Correct 5 ms 256 KB Output is correct
29 Correct 6 ms 256 KB Output is correct
30 Correct 5 ms 304 KB Output is correct
31 Correct 5 ms 256 KB Output is correct
32 Correct 5 ms 384 KB Output is correct
33 Correct 5 ms 256 KB Output is correct
34 Correct 5 ms 256 KB Output is correct
35 Correct 5 ms 256 KB Output is correct
36 Correct 5 ms 256 KB Output is correct
37 Correct 5 ms 256 KB Output is correct
38 Correct 5 ms 256 KB Output is correct
39 Correct 5 ms 256 KB Output is correct
40 Correct 5 ms 256 KB Output is correct
41 Correct 5 ms 256 KB Output is correct
42 Correct 5 ms 512 KB Output is correct