Submission #924304

#TimeUsernameProblemLanguageResultExecution timeMemory
924304rainboy방 배정 (KOI16_room)C11
100 / 100
1 ms600 KiB
#include <stdio.h>

#define T	6

int main() {
	static int kk[T];
	int n, k, t, cnt;

	scanf("%d%d", &n, &k);
	while (n--) {
		int s, y;

		scanf("%d%d", &s, &y);
		kk[y <= 2 ? 0 : ((y - 3) / 2 << 1 | s) + 1]++;
	}
	cnt = 0;
	for (t = 0; t < T; t++)
		cnt += (kk[t] + k - 1) / k;
	printf("%d\n", cnt);
	return 0;
}

Compilation message (stderr)

room.c: In function 'main':
room.c:9:2: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
    9 |  scanf("%d%d", &n, &k);
      |  ^~~~~~~~~~~~~~~~~~~~~
room.c:13:3: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   13 |   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...