| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 | 
|---|---|---|---|---|---|---|---|
| 934499 | TIN | Kas (COCI17_kas) | C++17 | 157 ms | 1784 KiB | 
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5 + 5;
const int INF = 2e9;
void Task() {
	ios_base::sync_with_stdio(false);
	cin.tie(0); cout.tie(0);
	cout << fixed << setprecision(9);
	if (fopen("test.inp","r")) {
		freopen("test.inp","r",stdin);
		freopen("test.out","w",stdout);
	}
}
void Solve() {
	//Your Code
	int n;
	cin >> n;
	vector<int> dp1, dp2;
	dp1.resize(MAXN, INF);
	dp2.resize(MAXN);
	dp1[0] = 0;
	int sum = 0;
	for (int j = 0; j < n; j++) {
		int x;
		cin >> x;
		sum += x;
		dp2 = dp1;
		dp1.assign(dp1.size(), INF);
		for (int v = 0; v < MAXN; ++v) {
			if (x + v < MAXN) dp1[x + v] = min(dp1[x + v], dp2[v]);
			dp1[abs(v - x)] = min(dp1[abs(v - x)], dp2[v]);
			dp1[v] = min(dp1[v], dp2[v] + x);
		}
	}
	cout << (sum - dp1[0]) / 2 + dp1[0] << '\n';
}
int main() {
	Task();
	Solve();
	cerr << "\nTime run: " << 1000*clock()/CLOCKS_PER_SEC << "ms";
	return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
