제출 #448729

#제출 시각아이디문제언어결과실행 시간메모리
448729pdstiagoDetecting Molecules (IOI16_molecules)C++14
0 / 100
1099 ms272 KiB
#include <bits/stdc++.h> using namespace std; #define MOD 1000000007 #define mxn 100005 #define mxm 105 #define f first #define s second #define pb push_back #define es " " #define endl '\n' #define INF 0x3f3f3f3f #define INFL 0x3f3f3f3f3f3f3f3f #define ll long long #define fastio ios_base::sync_with_stdio(0), cin.tie(0) #define sz(x) (int)x.size() #define all(x) x.begin(), x.end() typedef pair<int, int> pii; typedef pair<int, pii> pip; vector<int> find_subset(int l, int u, vector<int> w){ vector<int> resp; sort(all(w)); multiset<pii> sla; int le=0, r=0, n=sz(w); ll soma=0; while(1){ if(soma>=l && soma<=u){ for(pii i:sla){ resp.pb(i.s); } return resp; } while(r<n && soma<l){ soma+=w[r]; sla.insert({w[r], r}); r++; } while(le<n && soma>u){ sla.erase(sla.find({w[le], le})); soma-=w[le]; le++; } } return {}; } // int main(){ // fastio; // return 0; // }
#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...