제출 #434416

#제출 시각아이디문제언어결과실행 시간메모리
434416OttoTheDinoDetecting Molecules (IOI16_molecules)C++17
0 / 100
1 ms204 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...