Submission #159560

#TimeUsernameProblemLanguageResultExecution timeMemory
159560geon040702방 배정 (KOI16_aa)C++14
100 / 100
5 ms392 KiB
#include <bits/stdc++.h> using namespace std; int Male[10], Female[10]; int student, full_room, ans; int main(void) { int i, gender, grade; scanf("%d %d", &student, &full_room); for(i=0;i<student;i++) { scanf("%d %d", &gender, &grade); if(gender == 0) { Female[grade]++; } else { Male[grade]++; } } for(i=1;i<=6;i++) { ans += (Male[i] + full_room - 1) / full_room; ans += (Female[i] + full_room - 1) / full_room; } printf("%d\n", ans); return 0; }

Compilation message (stderr)

aa.cpp: In function 'int main()':
aa.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);
     ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
aa.cpp:13: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...