Submission #84027

#TimeUsernameProblemLanguageResultExecution timeMemory
84027tjdgus4384방 배정 (KOI16_room)C++14
100 / 100
3 ms976 KiB
#include<cstdio> #include<vector> using namespace std; int st[2][7]; int main() { int n, k, s, y; scanf("%d %d", &n, &k); for(int i = 0;i < n;i++) { scanf("%d %d", &s, &y); st[s][y]++; } int ans = 0; ans += (st[0][1] + st[0][2] + st[1][1] + st[1][2] + k - 1) / k; ans += (st[0][3] + st[0][4] + k - 1) / k; ans += (st[1][3] + st[1][4] + k - 1) / k; ans += (st[0][5] + st[0][6] + k - 1) / k; ans += (st[1][5] + st[1][6] + k - 1) / k; printf("%d", ans); return 0; }

Compilation message (stderr)

room.cpp: In function 'int main()':
room.cpp:9:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d %d", &n, &k);
     ~~~~~^~~~~~~~~~~~~~~~~
room.cpp:12:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%d %d", &s, &y);
         ~~~~~^~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...