Submission #1691039
Source Code Expand
#include <iostream> using namespace std; int main(void){ int A, B, C, D, E, F; cin>>A>>B>>C>>D>>E>>F; A *= 100, B *= 100; int suger[100], water[10000]; int i = 0, j = 0, k = 0, l = 0; for(i=0; A*i<=F || B*j<=F; i++){ for(j=0; (A*i + B*j)<=F || (A*i + B*j)<=F; j++){ if( (A*i + B*j)<=F ) suger[k++] = A*i + B*j; if( (C*i + D+j)<=F ) water[l++] = C*i + D*j; } } int ansSuger = 0, ansWater = 0; for(int i = 0; i < k; i++){ for(int j = 0; j < l; j++){ if( suger[i]+water[j] <= F ){ //F以下? if( 100*suger[i] <= water[j]*E ){ //E以下? if( ansWater*suger[i] >= water[j]*ansSuger ){ ansSuger = suger[i]; ansWater = water[j]; } } } } } cout << ansSuger+ansWater << ansSuger << endl; return 0; }
Submission Info
Submission Time | |
---|---|
Task | C - Sugar Water |
User | u_sho |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 1004 Byte |
Status | RE |
Exec Time | 129 ms |
Memory | 256 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 | WA | 1 ms | 256 KB |
02.txt | RE | 129 ms | 256 KB |
03.txt | RE | 106 ms | 256 KB |
04.txt | WA | 1 ms | 256 KB |
05.txt | RE | 109 ms | 256 KB |
06.txt | RE | 103 ms | 256 KB |
07.txt | RE | 109 ms | 256 KB |
08.txt | RE | 106 ms | 256 KB |
09.txt | RE | 109 ms | 256 KB |
subtask0_0.txt | RE | 115 ms | 256 KB |
subtask0_1.txt | RE | 116 ms | 256 KB |
subtask0_2.txt | RE | 103 ms | 256 KB |