Submission #5021993


Source Code Expand

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <time.h>

#define _CRT_SECURE_NO_WARNINGS
#define TLong long long
#define TBMod 1000000007

int main(int argc, char const *argv[])
{
	TLong n,y;
	TLong k;
	scanf("%lld%lld",&n,&y);

	for (TLong i = 0; i <= y / 10000; ++i)
	{
		for (TLong j = 0; j <= y / 5000; ++j)
		{
			k = n - (i + j);
			if(10000 * i + 5000 * j + 1000 * k == y && i + j + k == n){
				printf("%d %d %d\n", i,j,k);
				return 0;
			}
		}
	}
	puts("-1 -1 -1");
	return 0;
}

Submission Info

Submission Time
Task C - Otoshidama
User herp_sy
Language C (GCC 5.4.1)
Score 0
Code Size 559 Byte
Status WA
Exec Time 1 ms
Memory 128 KB

Compile Error

./Main.c: In function ‘main’:
./Main.c:23:12: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long long int’ [-Wformat=]
     printf("%d %d %d\n", i,j,k);
            ^
./Main.c:23:12: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘long long int’ [-Wformat=]
./Main.c:23:12: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘long long int’ [-Wformat=]
./Main.c:15:2: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
  scanf("%lld%lld",&n,&y);
  ^

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 300
Status
AC × 2
WA × 2
AC × 14
WA × 10
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 WA 1 ms 128 KB
a03 AC 1 ms 128 KB
a04 WA 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 WA 1 ms 128 KB
b10 AC 1 ms 128 KB
b11 WA 1 ms 128 KB
b12 AC 1 ms 128 KB
b13 AC 1 ms 128 KB
b14 AC 1 ms 128 KB
b15 WA 1 ms 128 KB
b16 WA 1 ms 128 KB
b17 WA 1 ms 128 KB
b18 AC 1 ms 128 KB
b19 WA 1 ms 128 KB
b20 AC 1 ms 128 KB
b21 AC 1 ms 128 KB
b22 AC 1 ms 128 KB
b23 WA 1 ms 128 KB
b24 WA 1 ms 128 KB