Submission #1882891


Source Code Expand

#include <iostream>
using namespace std;

int main() {
	int A,B,C,D,E,F,x=1,y=1;
	cin>>A>>B>>C>>D>>E>>F;
	for(int i=0;i<=F/(A*100);i++){
		int a=i*100*A;
		if(a>F) break;
		for(int j=0;j<=F/(B*100);j++){
			int b=j*100*B;
			if((a+b)>F) break;
			for(int k=0;k<=F/C;k++){
				int c=k*C;
				if(a+b+c>F) break;
				for(int l=0;l<=F/D;l++){
					int d=l*D;
					if(a+b+c+d>F||(c+d)>(a+b)/100*E) break;
					int n=a+b;
					int m=c+d;
					if(x*(n+m)<=m*(x+y)){
						x=m;
						y=n;
					}
				}
			}
		}
	} 
	cout<<x+y<<" "<<x;
	return 0;
}

Submission Info

Submission Time
Task C - Sugar Water
User vjudge4
Language C++14 (GCC 5.4.1)
Score 300
Code Size 539 Byte
Status AC
Exec Time 3 ms
Memory 256 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
AC × 3
AC × 12
Set Name Test Cases
Sample subtask0_0.txt, subtask0_1.txt, subtask0_2.txt
All 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, subtask0_0.txt, subtask0_1.txt, subtask0_2.txt
Case Name Status Exec Time Memory
01.txt AC 1 ms 256 KB
02.txt AC 1 ms 256 KB
03.txt AC 1 ms 256 KB
04.txt AC 1 ms 256 KB
05.txt AC 1 ms 256 KB
06.txt AC 1 ms 256 KB
07.txt AC 1 ms 256 KB
08.txt AC 1 ms 256 KB
09.txt AC 1 ms 256 KB
subtask0_0.txt AC 1 ms 256 KB
subtask0_1.txt AC 3 ms 256 KB
subtask0_2.txt AC 1 ms 256 KB