Submission #4061135
Source Code Expand
#include<cstdio>
int main(){
int n,m;
int cot = 0;
scanf("%d %d",&n,&m);
m /= 1000;
if(n > m || n * 10 < m) printf("-1 -1 -1");
else {
if(n * 10 == m) printf("%d 0 0\n",n);
else if(n * 5 == m) printf("0 %d 0\n",n);
else if(n == m) printf("0 0 %d\n",n);
else {
cot = 0;
for(int x = 1; x <= n; x++){
for(int y = 1; y <= n; y++){
for(int z = 1; z <= n; z++){
if((10 * x + 5 * y == m) && (x + y == n)) {printf("%d %d 0\n",x,y); return 0;}
else if((10 * x + z == m) && (x + z == n)) {printf("%d 0 %d\n",x,z); return 0;}
else if((5 * y + z == m) && (y + z == n)) {printf("0 %d %d\n",y,z); return 0;}
else if((10 * x + 5 * y + z == m) && (x + y + z == n)) {printf("%d %d %d\n",x,y,z); return 0;}
else cot++;
}
}
}
if(cot == n * n * n) printf("-1 -1 -1");
}
}
}
Submission Info
Submission Time
2019-01-21 10:31:03+0900
Task
C - Otoshidama
User
vjudge3
Language
C++14 (GCC 5.4.1)
Score
0
Code Size
830 Byte
Status
TLE
Exec Time
2107 ms
Memory
128 KB
Compile Error
./Main.cpp: In function ‘int main()’:
./Main.cpp:5:22: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%d %d",&n,&m);
^
Judge Result
Set Name
Sample
All
Score / Max Score
0 / 0
0 / 300
Status
Set Name
Test Cases
Sample
a01, a02, a03, a04
All
a01, a02, a03, a04, b05, b06, b07, b08, b09, b10, b11, b12, b13, b14, b15, b16, b17, b18, b19, b20, b21, b22, b23, b24
Case Name
Status
Exec Time
Memory
a01
AC
1 ms
128 KB
a02
AC
1 ms
128 KB
a03
AC
2 ms
128 KB
a04
AC
1 ms
128 KB
b05
AC
1 ms
128 KB
b06
AC
1 ms
128 KB
b07
AC
1 ms
128 KB
b08
AC
1 ms
128 KB
b09
AC
1 ms
128 KB
b10
AC
1 ms
128 KB
b11
AC
1 ms
128 KB
b12
AC
1 ms
128 KB
b13
AC
7 ms
128 KB
b14
AC
13 ms
128 KB
b15
TLE
2103 ms
128 KB
b16
TLE
2107 ms
128 KB
b17
TLE
2103 ms
128 KB
b18
AC
1 ms
128 KB
b19
AC
5 ms
128 KB
b20
AC
5 ms
128 KB
b21
TLE
2103 ms
128 KB
b22
TLE
2103 ms
128 KB
b23
TLE
2103 ms
128 KB
b24
TLE
2103 ms
128 KB