Submission #7019577


Source Code Expand

#include<iostream>
using namespace std;
 
int main(){
  int N,Y;
  cin>>N>>Y;
  int a,b;
  int c>=0;
  for(a=0;a<=N;a++){
    for(b=0;b<=N;b++){ 
      c=N-a-b;
          if(a+b+c<=N && a*10000+b*5000+c*1000==Y){
            cout<<a<<' '<<b<<' '<<c<<endl;
            return 0;
          
        }
      }
    }
    cout<<"-1 -1 -1"<<endl;
    return 0;
 }

Submission Info

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

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:8:8: error: expected initializer before ‘>=’ token
   int c>=0;
        ^
./Main.cpp:11:7: error: ‘c’ was not declared in this scope
       c=N-a-b;
       ^