Submission #600369


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 AC
Exec Time 29 ms
Memory 1052 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 100 / 100
Status
AC × 3
AC × 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 AC 27 ms 1048 KB
subtask0-sample-02.txt AC 24 ms 1044 KB
subtask0-sample-03.txt AC 28 ms 1028 KB
subtask1-01.txt AC 25 ms 1048 KB
subtask1-02.txt AC 26 ms 1048 KB
subtask1-03.txt AC 26 ms 1048 KB
subtask1-04.txt AC 24 ms 1036 KB
subtask1-05.txt AC 29 ms 1016 KB
subtask1-06.txt AC 28 ms 1044 KB
subtask1-07.txt AC 29 ms 932 KB
subtask1-08.txt AC 26 ms 1048 KB
subtask1-09.txt AC 25 ms 1048 KB
subtask1-10.txt AC 26 ms 1048 KB
subtask1-11.txt AC 26 ms 1048 KB
subtask1-12.txt AC 26 ms 1044 KB
subtask1-13.txt AC 25 ms 1052 KB
subtask1-14.txt AC 25 ms 1044 KB
subtask1-15.txt AC 25 ms 1052 KB
subtask1-16.txt AC 27 ms 1048 KB