이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "molecules.h"
#include <bits/stdc++.h>
using namespace std;
#define rep(i,s,e) for (int i = s; i <= e; ++i)
#define rrep(i,s,e) for (int i = s; i >= e; --i)
#define pb push_back
#define pf push_front
#define fi first
#define se second
#define all(a) a.begin(), a.end()
typedef long long ll;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<string> vs;
typedef vector<char> vc;
typedef vector<ll> vll;
vi find_subset(int l, int u, vi w) {
bool dp[2][u+1];
vi dpc[2][u+1] = {};
dp[1][0] = 1;
rep (i,0,(int)w.size()-1) {
rep (j,0,u) {
dp[i%2][u] = 0;
dpc[i%2][u].clear();
}
rep (j,1,u) {
if (j-w[i]>=0 && dp[(i%2)^1][j-w[i]]) {
dpc[i%2][j].pb(i);
dp[i%2][j] = 1;
}
}
}
rep (i,l,u) if (dp[((int)w.size()%2)^1][i]) return dpc[((int)w.size()%2)^1][i];
return vector<int>();
}
# | 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... |