제출 #297839

#제출 시각아이디문제언어결과실행 시간메모리
297839MuhammetaliDetecting Molecules (IOI16_molecules)C++11
9 / 100
1 ms256 KiB
#include "molecules.h" #include <bits/stdc++.h> #define mp make_pair #define f first #define s second #define sz(x) (int)(x).size() #define rsz resize #define ins insert #define ft front() #define bk back() #define pf push_front #define pb push_back #define eb emplace_back #define lb lower_bound #define ub upper_bound using namespace std; typedef long long ll; typedef long double ld; typedef pair<int,int> pi; typedef pair<ll,ll> pl; typedef vector<int> vi; typedef vector<bool> vb; typedef vector<ll> vl; typedef vector<pi> vpi; typedef vector<pl> vpl; vi find_subset(int l, int u, vi w) { int n=sz(w); vpi par; vi res; for (int i=0;i<n;i++)par.pb({w[i],i}); for (int i=0;i<n-1;i++) { for (int j=i;j<n-1;j++) { if (par[j].f>par[j+1].f) { swap(par[j],par[j+1]); } } } int q2=0,jem=0; while(q2<n) { if (jem+par[q2].f>u); else { jem+=par[q2].f; res.pb(par[q2].s); } q2++; } if (jem<l)res.clear(); return res; }
#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...