Submission #4668490


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 A - Already 2018
User mai2192
Language C++14 (GCC 5.4.1)
Score 0
Code Size 397 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:5:27: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d %d", &N, &Y);
                           ^