1886 | 2022-12-07 09:08:15 | Anna | Bevásárlás | cpp17 | Accepted 100/100 | 3ms | 4064 KiB |
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
int main()
{
int A, B, C;
int arA = 300, arB = 350, arC = 400, db = 10;
scanf("%d %d %d\n", &A, &B, &C);
if (A + B + C < db)
{
printf("-1");
return 0;
}
else if (A + B < db)
{
printf("%d", A * arA + B * arB + (db - (A + B)) * arC);
return 0;
}
else if (A < db)
{
printf("%d", A * arA + (db - A) * arB);
return 0;
}
else
{
printf("3000");
}
return 0;
}
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 3ms | 1940 KiB | ||||
2 | Accepted | 2ms | 2132 KiB | ||||
3 | Accepted | 2ms | 2484 KiB | ||||
subtask2 | 10/10 | ||||||
4 | Accepted | 2ms | 2620 KiB | ||||
5 | Accepted | 2ms | 2820 KiB | ||||
6 | Accepted | 2ms | 2980 KiB | ||||
subtask3 | 20/20 | ||||||
7 | Accepted | 2ms | 3124 KiB | ||||
8 | Accepted | 2ms | 3188 KiB | ||||
9 | Accepted | 2ms | 3388 KiB | ||||
10 | Accepted | 2ms | 3388 KiB | ||||
subtask4 | 30/30 | ||||||
11 | Accepted | 2ms | 3392 KiB | ||||
12 | Accepted | 2ms | 3492 KiB | ||||
13 | Accepted | 2ms | 3376 KiB | ||||
14 | Accepted | 2ms | 3508 KiB | ||||
subtask5 | 40/40 | ||||||
15 | Accepted | 2ms | 3624 KiB | ||||
16 | Accepted | 2ms | 3824 KiB | ||||
17 | Accepted | 2ms | 3916 KiB | ||||
18 | Accepted | 2ms | 3992 KiB | ||||
19 | Accepted | 2ms | 3936 KiB | ||||
20 | Accepted | 2ms | 4064 KiB |