Submission #159743

# Submission time Handle Problem Language Result Execution time Memory
159743 2019-10-24T12:05:20 Z geon040702 None (KOI16_room) C++14
100 / 100
3 ms 380 KB
#include <bits/stdc++.h>
using namespace std;

int Male[10], feMale[10];
int student, full, room_cnt;

int main(void)
{
    int i;
    scanf("%d %d", &student, &full);

    for(i=0;i<student;i++) {
        int gender, grade;
        scanf("%d %d", &gender, &grade);
        if(gender == 0) {
            feMale[grade]++;
        }
        else {
            Male[grade]++;
        }
    }

    room_cnt += (Male[1] + Male[2] + feMale[1] + feMale[2]) / full;
    if((Male[1] + Male[2] + feMale[1] + feMale[2]) % full != 0) {
        room_cnt++;
    }

    room_cnt += (Male[3] + Male[4]) / full;
    if((Male[3] + Male[4]) % full != 0) {
        room_cnt++;
    }

    room_cnt += (feMale[3] + feMale[4]) / full;
    if((feMale[3] + feMale[4]) % full != 0) {
        room_cnt++;
    }

    room_cnt += (Male[5] + Male[6]) / full;
    if((Male[5] + Male[6]) % full != 0) {
        room_cnt++;
    }

    room_cnt += (feMale[5] + feMale[6]) / full;
    if((feMale[5] + feMale[6]) % full != 0) {
        room_cnt++;
    }

    printf("%d\n", room_cnt);

    return 0;
}

Compilation message

room.cpp: In function 'int main()':
room.cpp:10:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d %d", &student, &full);
     ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
room.cpp:14:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%d %d", &gender, &grade);
         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 2 ms 256 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 2 ms 376 KB Output is correct
4 Correct 2 ms 256 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 256 KB Output is correct
2 Correct 2 ms 256 KB Output is correct
3 Correct 2 ms 256 KB Output is correct
4 Correct 2 ms 256 KB Output is correct
5 Correct 2 ms 376 KB Output is correct
6 Correct 2 ms 256 KB Output is correct
7 Correct 2 ms 256 KB Output is correct
8 Correct 2 ms 380 KB Output is correct
9 Correct 2 ms 376 KB Output is correct
10 Correct 2 ms 376 KB Output is correct
11 Correct 2 ms 256 KB Output is correct
12 Correct 2 ms 376 KB Output is correct
13 Correct 2 ms 256 KB Output is correct
14 Correct 2 ms 256 KB Output is correct
15 Correct 2 ms 256 KB Output is correct
16 Correct 2 ms 256 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 256 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 2 ms 376 KB Output is correct
4 Correct 2 ms 376 KB Output is correct
5 Correct 2 ms 376 KB Output is correct
6 Correct 2 ms 256 KB Output is correct
7 Correct 2 ms 256 KB Output is correct
8 Correct 2 ms 256 KB Output is correct
9 Correct 2 ms 256 KB Output is correct
10 Correct 2 ms 256 KB Output is correct
11 Correct 2 ms 376 KB Output is correct
12 Correct 2 ms 256 KB Output is correct
13 Correct 2 ms 256 KB Output is correct
14 Correct 2 ms 380 KB Output is correct
15 Correct 2 ms 376 KB Output is correct
16 Correct 2 ms 376 KB Output is correct
17 Correct 2 ms 256 KB Output is correct
18 Correct 2 ms 376 KB Output is correct
19 Correct 2 ms 256 KB Output is correct
20 Correct 2 ms 256 KB Output is correct
21 Correct 2 ms 256 KB Output is correct
22 Correct 2 ms 256 KB Output is correct
23 Correct 2 ms 256 KB Output is correct
24 Correct 2 ms 256 KB Output is correct
25 Correct 2 ms 256 KB Output is correct
26 Correct 2 ms 256 KB Output is correct
27 Correct 2 ms 256 KB Output is correct
28 Correct 2 ms 256 KB Output is correct
29 Correct 2 ms 376 KB Output is correct
30 Correct 2 ms 380 KB Output is correct
31 Correct 2 ms 256 KB Output is correct
32 Correct 2 ms 376 KB Output is correct
33 Correct 2 ms 380 KB Output is correct
34 Correct 2 ms 376 KB Output is correct
35 Correct 3 ms 256 KB Output is correct
36 Correct 2 ms 376 KB Output is correct
37 Correct 2 ms 376 KB Output is correct
38 Correct 2 ms 256 KB Output is correct
39 Correct 2 ms 256 KB Output is correct
40 Correct 2 ms 256 KB Output is correct
41 Correct 2 ms 256 KB Output is correct
42 Correct 2 ms 376 KB Output is correct