Submission #1873545
Source Code Expand
#include<iostream> using namespace std; typedef long long LL; const int INF = int(1e9); double A,B,C,D,E,F; double Ai,Bi; double maxx1 = -1,maxx2 = 1; int main() { cin>>A>>B>>C>>D>>E>>F; Ai = A*E; Bi = B*E; double tan,kefan,sum; for(int a = 0;a*A*100<=F;a++) for(int b = 0;b*B*100<=F-a*A*100;b++) for(int c = 0;c*C<=F-a*A*100-b*B*100;c++) for(int d = 0;d*D<=F-a*A*100-b*B*100-c*C;d++) { tan = c*C+d*D; sum = A*a*100+B*b*100+tan; kefan = Ai*a+Bi*b; //cout<<a<<"->"<<b<<" "<<c<<" "<<d<<endl; // cout<<sum<<" "<<tan<<" "<<kefan<<endl; if(kefan<tan||sum>F)continue; if(sum!=0&&tan/sum>maxx2/maxx1){ maxx1 = sum; maxx2 = tan; } } cout<<int(maxx1)<<" "<<int(maxx2)<<endl; return 0; }
Submission Info
Submission Time | |
---|---|
Task | C - Sugar Water |
User | vjudge3 |
Language | Bash (GNU bash v4.3.11) |
Score | 0 |
Code Size | 816 Byte |
Status | RE |
Exec Time | 22 ms |
Memory | 608 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 300 | ||||
Status |
|
|
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 | RE | 22 ms | 608 KB |
02.txt | RE | 3 ms | 504 KB |
03.txt | RE | 3 ms | 504 KB |
04.txt | RE | 2 ms | 504 KB |
05.txt | RE | 2 ms | 504 KB |
06.txt | RE | 3 ms | 504 KB |
07.txt | RE | 3 ms | 504 KB |
08.txt | RE | 3 ms | 504 KB |
09.txt | RE | 3 ms | 504 KB |
subtask0_0.txt | RE | 3 ms | 504 KB |
subtask0_1.txt | RE | 2 ms | 504 KB |
subtask0_2.txt | RE | 3 ms | 504 KB |