# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
159743 | geon040702 | 방 배정 (KOI16_room) | C++14 | 3 ms | 380 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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 (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |