Submission #8826509


Source Code Expand

#include <bits/stdc++.h>
using namespace std;
template<typename T> inline bool chmax(T& a,T b) { if (a < b) { a = b; return true; } return false; }
template<typename T> inline bool chmin(T& a,T b) { if (a > b) { a = b; return true; } return false; }

int main() {
    vector<int> box(3), ob(3);
    for(auto &A : box) cin >> A; sort(box.begin(), box.end());
    for(auto &B : ob) cin >> B; sort(ob.begin(), ob.end());
    
    int ans = 0;
    while (true) {
        sort(box.begin(), box.end());
        while (true) {
            int res = 1;
            for (int i = 0; i < 3; i++) res *= (box[i]/ob[i]);
            chmax(ans, res);
            if (!next_permutation(box.begin(), box.end())) break;
        }
        if (!next_permutation(ob.begin(), ob.end())) break;
    }
    cout << ans << endl;
    return 0;
}

Submission Info

Submission Time
Task A - 梱包できるかな?
User kya
Language C++14 (GCC 5.4.1)
Score 100
Code Size 842 Byte
Status AC
Exec Time 1 ms
Memory 256 KB

Judge Result

Set Name All
Score / Max Score 100 / 100
Status
AC × 35
Set Name Test Cases
All 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt, 00_sample_04.txt, 01_rand_00.txt, 01_rand_01.txt, 01_rand_02.txt, 01_rand_03.txt, 01_rand_04.txt, 01_rand_05.txt, 01_rand_06.txt, 01_rand_07.txt, 01_rand_08.txt, 01_rand_09.txt, 01_rand_10.txt, 01_rand_11.txt, 01_rand_12.txt, 01_rand_13.txt, 01_rand_14.txt, 01_rand_15.txt, 01_rand_16.txt, 01_rand_17.txt, 01_rand_18.txt, 01_rand_19.txt, 01_rand_20.txt, 01_rand_21.txt, 01_rand_22.txt, 01_rand_23.txt, 01_rand_24.txt, 01_rand_25.txt, 01_rand_26.txt, 01_rand_27.txt, 01_rand_28.txt, 01_rand_29.txt, 99_min.txt
Case Name Status Exec Time Memory
00_sample_01.txt AC 1 ms 256 KB
00_sample_02.txt AC 1 ms 256 KB
00_sample_03.txt AC 1 ms 256 KB
00_sample_04.txt AC 1 ms 256 KB
01_rand_00.txt AC 1 ms 256 KB
01_rand_01.txt AC 1 ms 256 KB
01_rand_02.txt AC 1 ms 256 KB
01_rand_03.txt AC 1 ms 256 KB
01_rand_04.txt AC 1 ms 256 KB
01_rand_05.txt AC 1 ms 256 KB
01_rand_06.txt AC 1 ms 256 KB
01_rand_07.txt AC 1 ms 256 KB
01_rand_08.txt AC 1 ms 256 KB
01_rand_09.txt AC 1 ms 256 KB
01_rand_10.txt AC 1 ms 256 KB
01_rand_11.txt AC 1 ms 256 KB
01_rand_12.txt AC 1 ms 256 KB
01_rand_13.txt AC 1 ms 256 KB
01_rand_14.txt AC 1 ms 256 KB
01_rand_15.txt AC 1 ms 256 KB
01_rand_16.txt AC 1 ms 256 KB
01_rand_17.txt AC 1 ms 256 KB
01_rand_18.txt AC 1 ms 256 KB
01_rand_19.txt AC 1 ms 256 KB
01_rand_20.txt AC 1 ms 256 KB
01_rand_21.txt AC 1 ms 256 KB
01_rand_22.txt AC 1 ms 256 KB
01_rand_23.txt AC 1 ms 256 KB
01_rand_24.txt AC 1 ms 256 KB
01_rand_25.txt AC 1 ms 256 KB
01_rand_26.txt AC 1 ms 256 KB
01_rand_27.txt AC 1 ms 256 KB
01_rand_28.txt AC 1 ms 256 KB
01_rand_29.txt AC 1 ms 256 KB
99_min.txt AC 1 ms 256 KB