Submission #4069922


Source Code Expand

#include<stdio.h>
int main() {
	int n, y;
	scanf("%d %d", &n, &y);
	int s = 0;
	int flag = 0;
	for(int i = 0; i <= n; i++) {
		for(int j = 0; j <= n; j++) {
			for(int k = 0; k <= n; k++) {
				s = i * 10000 + j * 5000 + k * 1000;
				if(s == y && i + j + k == n) {
					flag = 1;
					printf("%d %d %d\n", i, j ,k);
					return 0;
				}
			}
		}
	}
	if(flag == 0) printf("-1 -1 -1\n");
	return 0;
}

Submission Info

Submission Time
Task C - Otoshidama
User vjudge4
Language C++14 (GCC 5.4.1)
Score 0
Code Size 399 Byte
Status TLE
Exec Time 2103 ms
Memory 128 KB

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:4:24: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d %d", &n, &y);
                        ^

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 300
Status
AC × 3
TLE × 1
AC × 13
TLE × 11
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 TLE 2103 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 TLE 2103 ms 128 KB
b10 TLE 2103 ms 128 KB
b11 TLE 2103 ms 128 KB
b12 AC 1 ms 128 KB
b13 AC 5 ms 128 KB
b14 AC 8 ms 128 KB
b15 TLE 2103 ms 128 KB
b16 TLE 2103 ms 128 KB
b17 TLE 2103 ms 128 KB
b18 AC 1 ms 128 KB
b19 AC 3 ms 128 KB
b20 AC 2 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