Submission #1951082
Source Code Expand
#include<stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
int main()
{
int N;
long int Y;
int i;
int en10=0;
int en5=0;
int en1=0;
// 整数の入力
scanf("%d %ld", &N, &Y);
// printf("%d\n",N);
for(i=0;i<N;i++){
if(10000<=Y){
Y= Y - 10000;
en10++;
}
else{
break;
}
}
N = N - en10;
for(i=0;i<N;i++){
if(5000<=Y){
Y= Y - 5000;
en5++;
}
else{
break;
}
}
N = N - en5;
for(i=0;i<N;i++){
if(1000<=Y){
Y= Y - 1000;
en1++;
}
else{
break;
}
}
N = N - en1;
printf("%d %d %d %d %d\n",en10, en5, en1, N, Y);
if(0!=Y){
en10 = -1;
en5 = -1;
en1 = -1;
}
printf("%d %d %d\n",en10, en5, en1);
return 0;
}
Submission Info
Submission Time
2018-01-07 21:56:58+0900
Task
C - Otoshidama
User
te_ne5525
Language
C (GCC 5.4.1)
Score
0
Code Size
970 Byte
Status
WA
Exec Time
1 ms
Memory
128 KB
Compile Error
./Main.c: In function ‘main’:
./Main.c:55:12: warning: format ‘%d’ expects argument of type ‘int’, but argument 6 has type ‘long int’ [-Wformat=]
printf("%d %d %d %d %d\n",en10, en5, en1, N, Y);
^
./Main.c:18:5: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%d %ld", &N, &Y);
^
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
WA
1 ms
128 KB
a02
WA
1 ms
128 KB
a03
WA
1 ms
128 KB
a04
WA
1 ms
128 KB
b05
WA
1 ms
128 KB
b06
WA
1 ms
128 KB
b07
WA
1 ms
128 KB
b08
WA
1 ms
128 KB
b09
WA
1 ms
128 KB
b10
WA
1 ms
128 KB
b11
WA
1 ms
128 KB
b12
WA
1 ms
128 KB
b13
WA
1 ms
128 KB
b14
WA
1 ms
128 KB
b15
WA
1 ms
128 KB
b16
WA
1 ms
128 KB
b17
WA
1 ms
128 KB
b18
WA
1 ms
128 KB
b19
WA
1 ms
128 KB
b20
WA
1 ms
128 KB
b21
WA
1 ms
128 KB
b22
WA
1 ms
128 KB
b23
WA
1 ms
128 KB
b24
WA
1 ms
128 KB