답안 #84027

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
84027 2018-11-12T12:21:53 Z tjdgus4384 방 배정 (KOI16_room) C++14
100 / 100
3 ms 976 KB
#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

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);
         ~~~~~^~~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 384 KB Output is correct
2 Correct 2 ms 536 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 592 KB Output is correct
2 Correct 3 ms 764 KB Output is correct
3 Correct 3 ms 764 KB Output is correct
4 Correct 2 ms 764 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 764 KB Output is correct
2 Correct 2 ms 764 KB Output is correct
3 Correct 2 ms 764 KB Output is correct
4 Correct 2 ms 764 KB Output is correct
5 Correct 2 ms 764 KB Output is correct
6 Correct 2 ms 764 KB Output is correct
7 Correct 2 ms 764 KB Output is correct
8 Correct 2 ms 768 KB Output is correct
9 Correct 2 ms 768 KB Output is correct
10 Correct 2 ms 884 KB Output is correct
11 Correct 2 ms 884 KB Output is correct
12 Correct 2 ms 884 KB Output is correct
13 Correct 2 ms 892 KB Output is correct
14 Correct 2 ms 892 KB Output is correct
15 Correct 2 ms 892 KB Output is correct
16 Correct 2 ms 892 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 384 KB Output is correct
2 Correct 2 ms 536 KB Output is correct
3 Correct 2 ms 592 KB Output is correct
4 Correct 3 ms 764 KB Output is correct
5 Correct 3 ms 764 KB Output is correct
6 Correct 2 ms 764 KB Output is correct
7 Correct 2 ms 764 KB Output is correct
8 Correct 2 ms 764 KB Output is correct
9 Correct 2 ms 764 KB Output is correct
10 Correct 2 ms 764 KB Output is correct
11 Correct 2 ms 764 KB Output is correct
12 Correct 2 ms 764 KB Output is correct
13 Correct 2 ms 764 KB Output is correct
14 Correct 2 ms 768 KB Output is correct
15 Correct 2 ms 768 KB Output is correct
16 Correct 2 ms 884 KB Output is correct
17 Correct 2 ms 884 KB Output is correct
18 Correct 2 ms 884 KB Output is correct
19 Correct 2 ms 892 KB Output is correct
20 Correct 2 ms 892 KB Output is correct
21 Correct 2 ms 892 KB Output is correct
22 Correct 2 ms 892 KB Output is correct
23 Correct 2 ms 892 KB Output is correct
24 Correct 2 ms 892 KB Output is correct
25 Correct 2 ms 892 KB Output is correct
26 Correct 2 ms 892 KB Output is correct
27 Correct 2 ms 892 KB Output is correct
28 Correct 2 ms 892 KB Output is correct
29 Correct 2 ms 892 KB Output is correct
30 Correct 2 ms 892 KB Output is correct
31 Correct 2 ms 892 KB Output is correct
32 Correct 2 ms 892 KB Output is correct
33 Correct 2 ms 896 KB Output is correct
34 Correct 3 ms 900 KB Output is correct
35 Correct 2 ms 904 KB Output is correct
36 Correct 2 ms 908 KB Output is correct
37 Correct 2 ms 932 KB Output is correct
38 Correct 2 ms 956 KB Output is correct
39 Correct 2 ms 964 KB Output is correct
40 Correct 3 ms 968 KB Output is correct
41 Correct 2 ms 972 KB Output is correct
42 Correct 2 ms 976 KB Output is correct