Submission #600370


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 362 Byte
Status
Exec Time 28 ms
Memory 1044 KB

Test Cases

Set Name Score / Max Score Test Cases
Sample 0 / 0 subtask0-sample-01.txt, subtask0-sample-02.txt, subtask0-sample-03.txt
All 100 / 100 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 28 ms 1000 KB
subtask0-sample-02.txt 27 ms 1044 KB
subtask0-sample-03.txt 26 ms 1036 KB
subtask1-01.txt 26 ms 1040 KB
subtask1-02.txt 26 ms 1044 KB
subtask1-03.txt 26 ms 1040 KB
subtask1-04.txt 26 ms 1044 KB
subtask1-05.txt 26 ms 936 KB
subtask1-06.txt 27 ms 1040 KB
subtask1-07.txt 25 ms 1044 KB
subtask1-08.txt 28 ms 1040 KB
subtask1-09.txt 27 ms 1040 KB
subtask1-10.txt 28 ms 932 KB
subtask1-11.txt 27 ms 1044 KB
subtask1-12.txt 28 ms 1040 KB
subtask1-13.txt 27 ms 1044 KB
subtask1-14.txt 28 ms 1040 KB
subtask1-15.txt 27 ms 1040 KB
subtask1-16.txt 27 ms 976 KB