# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
120059 | E869120 | Tug of War (BOI15_tug) | C++14 | 211 ms | 85468 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <iostream>
#include <vector>
#include <queue>
#include <set>
using namespace std;
#pragma warning (disable: 4996)
bool dp[2009][80009];
bool solve(int N, int K, vector<pair<int, int>>G) {
dp[0][40000] = true;
for (int i = 0; i < G.size(); i++) {
for (int j = 0; j <= 80000; j++) {
if (dp[i][j] == false) continue;
dp[i + 1][j + G[i].first] = true;
dp[i + 1][j + G[i].second] = true;
}
}
for (int i = 40000 - K; i <= 40000 + K; i++) {
if (dp[G.size()][i] == true) return true;
}
return false;
}
set<pair<int, int>> G[60009];
int N, K, V1, V2, A[60009], B[60009], S[60009]; bool used[60009], colored[60009];
vector<pair<int, int>> X[60009];
int main() {
scanf("%d%d", &N, &K);
Compilation message (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... |