Submission #3092521


Source Code Expand

Copy
#include<bits/stdc++.h>
using namespace std;
double s=0,n;
int t;
struct jq
{
    double V,d,j;
};
jq a[5];
bool camp(const jq &a,const jq &b)
{
	return a.d<b.d;
}
bool camp2(const jq &a,const jq &b)
{
	return a.j<b.j;
}
int main()
{
    cin>>a[1].j>>a[2].j>>a[3].j>>a[4].j>>n;
    a[1].V=0.25;
    a[2].V=0.5;
    a[3].V=1;
    a[4].V=2;    
    a[1].d=a[1].j/0.25;
    a[2].d=a[2].j/0.5;
    a[3].d=a[3].j/1;
    a[4].d=a[4].j/2;
    sort(a+1,a+5,camp);  
    while(n>=a[1].V)
    {
	    n-=a[1].V;  
		++t; 	 
    }
	s=s+t*a[1].j;
    sort(a+1,a+5,camp2);
	for(int i=1;i<=4;++i)
    {
        t=n/a[i].V;
        if(a[i].V*t<n)
        {
        	++t;
		}
        a[i].V*=t;
        a[i].j*=t;
	}
	sort(a+1,a+5,camp2);
    s+=a[1].j;
	cout<<s;
}

Submission Info

Submission Time
Task A - Ice Tea Store
User luogu_bot2
Language C++ (GCC 5.4.1)
Score 0
Code Size 797 Byte
Status
Exec Time 2103 ms
Memory 384 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 161 ms 256 KB
subtask_1_01.txt 1 ms 256 KB
subtask_1_02.txt 648 ms 256 KB
subtask_1_03.txt 648 ms 256 KB
subtask_1_04.txt 653 ms 256 KB
subtask_1_05.txt 1432 ms 384 KB
subtask_1_06.txt 362 ms 256 KB
subtask_1_07.txt 12 ms 256 KB
subtask_1_08.txt 384 ms 384 KB
subtask_1_09.txt 479 ms 256 KB
subtask_1_10.txt 1134 ms 256 KB
subtask_1_11.txt 2103 ms 256 KB
subtask_1_12.txt 1295 ms 256 KB
subtask_1_13.txt 613 ms 256 KB
subtask_1_14.txt 639 ms 256 KB
subtask_1_15.txt 377 ms 256 KB