Submission #1539588


Source Code Expand

#include <stdio.h>

int main(void) {
	int Q, H, S, D;
	long long N, L[4];
	scanf("%d%d%d%d%lld", &Q, &H, &S, &D, &N);
	L[3] = N / 2LL;
	L[2] = (N % 2LL);
	L[0] = 0LL; L[1] = 0LL;
	if (Q*8 < D) {
		L[0] += L[3]*8LL;
		L[3] = 0LL;
	} else if (H*4 < D) {
		L[1] += L[3]*4LL;
		L[3] = 0LL;
	} else if (S*2 < D) {
		L[2] += L[3]*2LL;
		L[3] = 0LL;
	}
	if (Q*4 < S) {
		L[0] += L[2]*4LL;
		L[2] = 0LL;
	} else if (H*2 < S) {
		L[1] += L[2]*2LL;
		L[2] = 0LL;
	}
	if (Q*2 < H) {
		L[0] += L[1]*2LL;
		L[1] = 0LL;
	}

	printf("%lld\n", Q*L[0]+H*L[1]+S*L[2]+D*L[3]);
	return 0;
}

Submission Info

Submission Time
Task A - Ice Tea Store
User k_ashiya
Language C (GCC 5.4.1)
Score 300
Code Size 603 Byte
Status AC
Exec Time 1 ms
Memory 128 KB

Compile Error

./Main.c: In function ‘main’:
./Main.c:6:2: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d%d%d%d%lld", &Q, &H, &S, &D, &N);
  ^

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
AC × 4
AC × 23
Set Name Test Cases
Sample sample_01.txt, sample_02.txt, sample_03.txt, sample_04.txt
All sample_01.txt, sample_02.txt, sample_03.txt, sample_04.txt, sample_01.txt, sample_02.txt, sample_03.txt, sample_04.txt, subtask_1_01.txt, subtask_1_02.txt, subtask_1_03.txt, subtask_1_04.txt, subtask_1_05.txt, subtask_1_06.txt, subtask_1_07.txt, subtask_1_08.txt, subtask_1_09.txt, subtask_1_10.txt, subtask_1_11.txt, subtask_1_12.txt, subtask_1_13.txt, subtask_1_14.txt, subtask_1_15.txt
Case Name Status Exec Time Memory
sample_01.txt AC 1 ms 128 KB
sample_02.txt AC 1 ms 128 KB
sample_03.txt AC 1 ms 128 KB
sample_04.txt AC 1 ms 128 KB
subtask_1_01.txt AC 1 ms 128 KB
subtask_1_02.txt AC 1 ms 128 KB
subtask_1_03.txt AC 1 ms 128 KB
subtask_1_04.txt AC 1 ms 128 KB
subtask_1_05.txt AC 1 ms 128 KB
subtask_1_06.txt AC 1 ms 128 KB
subtask_1_07.txt AC 1 ms 128 KB
subtask_1_08.txt AC 1 ms 128 KB
subtask_1_09.txt AC 1 ms 128 KB
subtask_1_10.txt AC 1 ms 128 KB
subtask_1_11.txt AC 1 ms 128 KB
subtask_1_12.txt AC 1 ms 128 KB
subtask_1_13.txt AC 1 ms 128 KB
subtask_1_14.txt AC 1 ms 128 KB
subtask_1_15.txt AC 1 ms 128 KB