Submission #159743

#TimeUsernameProblemLanguageResultExecution timeMemory
159743geon040702방 배정 (KOI16_room)C++14
100 / 100
3 ms380 KiB
#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)

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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...