Submission #600368


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 43 ms
Memory 2064 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 43 ms 1912 KB
subtask0-sample-02.txt 34 ms 2040 KB
subtask0-sample-03.txt 33 ms 1920 KB
subtask1-01.txt 35 ms 2036 KB
subtask1-02.txt 32 ms 1812 KB
subtask1-03.txt 33 ms 1948 KB
subtask1-04.txt 33 ms 1940 KB
subtask1-05.txt 33 ms 1820 KB
subtask1-06.txt 32 ms 1944 KB
subtask1-07.txt 32 ms 1812 KB
subtask1-08.txt 33 ms 1908 KB
subtask1-09.txt 34 ms 2064 KB
subtask1-10.txt 33 ms 1812 KB
subtask1-11.txt 33 ms 2032 KB
subtask1-12.txt 32 ms 1940 KB
subtask1-13.txt 33 ms 1904 KB
subtask1-14.txt 32 ms 1940 KB
subtask1-15.txt 34 ms 1944 KB
subtask1-16.txt 32 ms 1940 KB