답안 #58774

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
58774 2018-07-19T10:03:50 Z pos13050 방 배정하기 (KOI17_room) C++
100 / 100
24 ms 816 KB
#include <stdio.h>
#include <stdlib.h>

int main()
{
    int a,b,c,n,i,j,k;
    scanf("%d %d %d %d",&a,&b,&c,&n);
    for(i=0;i<=n;i++)
    {
        for(j=0;j<=n;j++)
        {
            for(k=0;k<=n;k++)
            {
                if(i*a+j*b+k*c==n)
                {
                    printf("1");
                    return 0;
                }
            }
        }
    }
    printf("0");
    return 0;
}

Compilation message

room.cpp: In function 'int main()':
room.cpp:7:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d %d %d %d",&a,&b,&c,&n);
     ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 256 KB Output is correct
2 Correct 4 ms 368 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 368 KB Output is correct
2 Correct 2 ms 612 KB Output is correct
3 Correct 3 ms 612 KB Output is correct
4 Correct 3 ms 612 KB Output is correct
5 Correct 2 ms 612 KB Output is correct
6 Correct 2 ms 612 KB Output is correct
7 Correct 2 ms 612 KB Output is correct
8 Correct 2 ms 612 KB Output is correct
9 Correct 4 ms 612 KB Output is correct
10 Correct 2 ms 676 KB Output is correct
11 Correct 2 ms 676 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 368 KB Output is correct
2 Correct 2 ms 612 KB Output is correct
3 Correct 3 ms 612 KB Output is correct
4 Correct 3 ms 612 KB Output is correct
5 Correct 2 ms 612 KB Output is correct
6 Correct 2 ms 612 KB Output is correct
7 Correct 2 ms 612 KB Output is correct
8 Correct 2 ms 612 KB Output is correct
9 Correct 4 ms 612 KB Output is correct
10 Correct 2 ms 676 KB Output is correct
11 Correct 2 ms 676 KB Output is correct
12 Correct 2 ms 676 KB Output is correct
13 Correct 2 ms 676 KB Output is correct
14 Correct 4 ms 720 KB Output is correct
15 Correct 14 ms 720 KB Output is correct
16 Correct 2 ms 720 KB Output is correct
17 Correct 13 ms 720 KB Output is correct
18 Correct 2 ms 720 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 256 KB Output is correct
2 Correct 4 ms 368 KB Output is correct
3 Correct 3 ms 368 KB Output is correct
4 Correct 2 ms 612 KB Output is correct
5 Correct 3 ms 612 KB Output is correct
6 Correct 3 ms 612 KB Output is correct
7 Correct 2 ms 612 KB Output is correct
8 Correct 2 ms 612 KB Output is correct
9 Correct 2 ms 612 KB Output is correct
10 Correct 2 ms 612 KB Output is correct
11 Correct 4 ms 612 KB Output is correct
12 Correct 2 ms 676 KB Output is correct
13 Correct 2 ms 676 KB Output is correct
14 Correct 2 ms 676 KB Output is correct
15 Correct 2 ms 676 KB Output is correct
16 Correct 4 ms 720 KB Output is correct
17 Correct 14 ms 720 KB Output is correct
18 Correct 2 ms 720 KB Output is correct
19 Correct 13 ms 720 KB Output is correct
20 Correct 2 ms 720 KB Output is correct
21 Correct 3 ms 720 KB Output is correct
22 Correct 2 ms 720 KB Output is correct
23 Correct 3 ms 776 KB Output is correct
24 Correct 2 ms 776 KB Output is correct
25 Correct 24 ms 816 KB Output is correct
26 Correct 4 ms 816 KB Output is correct
27 Correct 2 ms 816 KB Output is correct
28 Correct 3 ms 816 KB Output is correct
29 Correct 2 ms 816 KB Output is correct
30 Correct 3 ms 816 KB Output is correct
31 Correct 3 ms 816 KB Output is correct
32 Correct 20 ms 816 KB Output is correct