Submission #4668372


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++){
            for(int z = 0; z <= N - x - y; z++){
                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 446 Byte
Status CE

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:20:5: error: expected ‘;’ before ‘return’
     return 0;
     ^
./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);
                           ^