5728 | 2023-09-10 11:52:16 | SzaniszloDora | Bevásárlás | cpp11 | Accepted 100/100 | 3ms | 3728 KiB |
// Sziaa
//Zoli boldog :))
#include <bits/stdc++.h>
using namespace std;
int main() {
vector<int> ar={300, 350, 400};
vector<int> darab(3);
for(int i=0; i<3; i++) {
cin>>darab[i];
}
int x=10, osszeg=0;
for ( int i=0; i<3; i++) {
if(darab[i] >= x){
osszeg+=x*ar[i];
cout<<osszeg<<endl;
return 0;
}
osszeg+= darab[i]*ar[i];
x=x-darab[i];
}
if ( x>0){
cout<<-1<<endl;
}
else {cout<<osszeg<<endl;}
}
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 3ms | 1688 KiB | ||||
2 | Accepted | 2ms | 1844 KiB | ||||
3 | Accepted | 2ms | 2208 KiB | ||||
subtask2 | 10/10 | ||||||
4 | Accepted | 3ms | 2432 KiB | ||||
5 | Accepted | 2ms | 2496 KiB | ||||
6 | Accepted | 3ms | 2748 KiB | ||||
subtask3 | 20/20 | ||||||
7 | Accepted | 2ms | 2764 KiB | ||||
8 | Accepted | 2ms | 2836 KiB | ||||
9 | Accepted | 2ms | 2848 KiB | ||||
10 | Accepted | 2ms | 2952 KiB | ||||
subtask4 | 30/30 | ||||||
11 | Accepted | 3ms | 3148 KiB | ||||
12 | Accepted | 3ms | 3244 KiB | ||||
13 | Accepted | 2ms | 3328 KiB | ||||
14 | Accepted | 2ms | 3212 KiB | ||||
subtask5 | 40/40 | ||||||
15 | Accepted | 2ms | 3212 KiB | ||||
16 | Accepted | 3ms | 3464 KiB | ||||
17 | Accepted | 2ms | 3428 KiB | ||||
18 | Accepted | 2ms | 3420 KiB | ||||
19 | Accepted | 2ms | 3672 KiB | ||||
20 | Accepted | 2ms | 3728 KiB |