Submission #1873570


Source Code Expand

#include<iostream>
#include<string>
#include<algorithm>
#include <string.h>
#include <stdio.h>
#include <math.h>
#include <set>
#include <queue>
#include <stack>
#include <map>
 
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;
    

Submission Info

Submission Time
Task C - Sugar Water
User vjudge5
Language Bash (GNU bash v4.3.11)
Score 0
Code Size 966 Byte
Status RE
Exec Time 3 ms
Memory 504 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 300
Status
RE × 3
RE × 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 RE 3 ms 504 KB
02.txt RE 3 ms 504 KB
03.txt RE 3 ms 504 KB
04.txt RE 3 ms 504 KB
05.txt RE 3 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 3 ms 504 KB
subtask0_2.txt RE 3 ms 504 KB