Submission #4668481


Source Code Expand

#include <cstdio>

int main(){
    int N, Y;
    scanf("%d %d", &N, &Y);
    Y = Y / 1000;

    for(int x = 0; x <= N; x++){
        for(int y = 0; y <= N - x; y++){
            int z = N - x - y
            if(x * 10 + y * 5 + z == Y){
                printf("%d %d %d", x, y, z);
                return 0;
            }
            }
        }
    }

    printf("-1 -1 -1");
    return 0;
}

Submission Info

Submission Time
Task C - Otoshidama
User mai2192
Language C++14 (GCC 5.4.1)
Score 0
Code Size 412 Byte
Status CE

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:11:13: error: expected ‘,’ or ‘;’ before ‘if’
             if(x * 10 + y * 5 + z == Y){
             ^
./Main.cpp: At global scope:
./Main.cpp:19:11: error: expected constructor, destructor, or type conversion before ‘(’ token
     printf("-1 -1 -1");
           ^
./Main.cpp:20:5: error: expected unqualified-id before ‘return’
     return 0;
     ^
./Main.cpp:21:1: error: expected declaration before ‘}’ token
 }
 ^
./Main.cpp: In function ‘int main()’:
./Main.cpp:5:27: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d %d", &N, &Y);
                           ^