Submission #3923170


Source Code Expand

Copy
#include<bits/stdc++.h>
using namespace std;
struct pin
{
	double p,shu;
	long long xu; 
}a[5];
int cmp(pin x,pin y)
{
	return x.p<y.p;
}
int main()
{
	long long q,h,s,d,n,sum=0;
	cin>>q>>h>>s>>d>>n;
	a[1].p=q/0.25;a[2].p=h/0.5;a[3].p=s/1.0;a[4].p=d/2.0;
	a[1].xu=1;a[2].xu=2;a[3].xu=2;a[4].xu=4;
	a[1].shu=0.25;a[2].shu=0.5;a[3].shu=1;a[4].shu=2;
	sort(a+1,a+5,cmp);
	if(n>=2)
	{
		for(int i=1;i<=4;i++){
			sum+=int(n/a[i].shu)*a[i].p*a[i].shu;
			n-=int(n/a[i].shu)*a[i].shu;
			if(n<=0){
				cout<<sum<<endl;
				return 0;
			}
		}
	}
	else
	{
		if(a[1].xu==4)
		{
			cout<<int(a[2].p)<<endl;
			return 0;
		}
		else 
		{
			cout<<int(a[1].p)<<endl;
			return 0;
		}
	}
	return 0;
} 

Submission Info

Submission Time
Task A - Ice Tea Store
User luogu_bot2
Language C++ (GCC 5.4.1)
Score 0
Code Size 731 Byte
Status
Exec Time 1 ms
Memory 256 KB

Judge Result

Set Name Score / Max Score Test Cases
Sample 0 / 0 sample_01.txt, sample_02.txt, sample_03.txt, sample_04.txt
All 0 / 300 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 1 ms 256 KB
sample_02.txt 1 ms 256 KB
sample_03.txt 1 ms 256 KB
sample_04.txt 1 ms 256 KB
subtask_1_01.txt 1 ms 256 KB
subtask_1_02.txt 1 ms 256 KB
subtask_1_03.txt 1 ms 256 KB
subtask_1_04.txt 1 ms 256 KB
subtask_1_05.txt 1 ms 256 KB
subtask_1_06.txt 1 ms 256 KB
subtask_1_07.txt 1 ms 256 KB
subtask_1_08.txt 1 ms 256 KB
subtask_1_09.txt 1 ms 256 KB
subtask_1_10.txt 1 ms 256 KB
subtask_1_11.txt 1 ms 256 KB
subtask_1_12.txt 1 ms 256 KB
subtask_1_13.txt 1 ms 256 KB
subtask_1_14.txt 1 ms 256 KB
subtask_1_15.txt 1 ms 256 KB