Submission #600367


Source Code Expand

Copy
#include <bits/stdc++.h>

using namespace std;

int main()
{
    int n; cin >> n;
    int t[4];
    for(int i = 0; i < n; ++i) cin >> t[i];
    int mi = 1<<29;
    for(int i = 0; i < (1<<n); ++i) {
        int a, b; a = b = 0;
        for (int j = 0; j < n; ++j) {
            if (i >> j & i) a += t[j];
            else b += t[j];
        }
        mi = min(mi, max(a, b));
    }
    cout << mi << endl;
}

Submission Info

Submission Time
Task A - 高橋君とお肉
User Izryt
Language C++ (G++ 4.6.4)
Score 100
Code Size 425 Byte
Status
Exec Time 29 ms
Memory 1084 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 100 / 100
Status
× 3
× 19
Set Name Test Cases
Sample subtask0-sample-01.txt, subtask0-sample-02.txt, subtask0-sample-03.txt
All subtask0-sample-01.txt, subtask0-sample-02.txt, subtask0-sample-03.txt, subtask1-01.txt, subtask1-02.txt, subtask1-03.txt, subtask1-04.txt, subtask1-05.txt, subtask1-06.txt, subtask1-07.txt, subtask1-08.txt, subtask1-09.txt, subtask1-10.txt, subtask1-11.txt, subtask1-12.txt, subtask1-13.txt, subtask1-14.txt, subtask1-15.txt, subtask1-16.txt
Case Name Status Exec Time Memory
subtask0-sample-01.txt 29 ms 1048 KB
subtask0-sample-02.txt 26 ms 1044 KB
subtask0-sample-03.txt 27 ms 1052 KB
subtask1-01.txt 26 ms 1084 KB
subtask1-02.txt 27 ms 1048 KB
subtask1-03.txt 26 ms 1048 KB
subtask1-04.txt 27 ms 1052 KB
subtask1-05.txt 26 ms 1048 KB
subtask1-06.txt 27 ms 1048 KB
subtask1-07.txt 26 ms 1044 KB
subtask1-08.txt 27 ms 1044 KB
subtask1-09.txt 27 ms 1048 KB
subtask1-10.txt 27 ms 1052 KB
subtask1-11.txt 27 ms 1036 KB
subtask1-12.txt 27 ms 1052 KB
subtask1-13.txt 25 ms 1052 KB
subtask1-14.txt 27 ms 1040 KB
subtask1-15.txt 26 ms 1048 KB
subtask1-16.txt 25 ms 1040 KB