Submission #1540305


Source Code Expand

Copy
#include<iostream>
#include<math.h>
#include<cctype>
#include<cerrno>
#include<cfloat>
#include<ciso646>
#include<climits>
#include<clocale>
#include<cmath>
#include<csetjmp>
#include<csignal>
#include<cstdarg>
#include<cstddef>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<ctime>
#include<string>
#include<string.h>
#include<map>
#include<vector>
#include<set>
#include<algorithm>
#include<stdio.h>
using namespace std;
int main()
{
	int q,h,s,d;
	double n;
	vector<int>v;
	cin>>q>>h>>s>>d>>n;
	for(double i1=0;i1<=(int)n*4;i1+=1)
	for(double i2=0;i2<=(int)(n-i1/4)*2;i2+=1)
	for(double i3=0;i3<=(int)(n-i1/4-i2/2)*1;i3+=1)
	for(double i4=0;i4<=(int)(n-i1/4-i2/2-i3)/2;i4+=1)
	if(i1/4+i2/2+i3+i4*2==n)
	v.push_back(i1*q+i2*h+i3*s+i4*d);
	sort(v.begin(),v.end());
	cout<<v[0];
	return 0;
}

Submission Info

Submission Time
Task A - Ice Tea Store
User yishuhan
Language C++14 (GCC 5.4.1)
Score 0
Code Size 846 Byte
Status
Exec Time 2103 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 2103 ms 256 KB
subtask_1_01.txt 1 ms 256 KB
subtask_1_02.txt 303 ms 256 KB
subtask_1_03.txt 95 ms 256 KB
subtask_1_04.txt 2103 ms 256 KB
subtask_1_05.txt 94 ms 256 KB
subtask_1_06.txt 2103 ms 256 KB
subtask_1_07.txt 2103 ms 256 KB
subtask_1_08.txt 95 ms 256 KB
subtask_1_09.txt 94 ms 256 KB
subtask_1_10.txt 2103 ms 256 KB
subtask_1_11.txt 96 ms 256 KB
subtask_1_12.txt 95 ms 256 KB
subtask_1_13.txt 96 ms 256 KB
subtask_1_14.txt 95 ms 256 KB
subtask_1_15.txt 96 ms 256 KB