Submission #290821

#TimeUsernameProblemLanguageResultExecution timeMemory
290821aymane7Detecting Molecules (IOI16_molecules)C++17
100 / 100
61 ms3836 KiB
#include<bits/stdc++.h> #pragma GCC optimize("O2") #define F first #define S second #define PB push_back #define MP make_pair #define all(c) c.begin(), c.end() #define endl "\n" #define sz(u) (int)(u.size()) #define L(x)(2*x) #define R(x)(2*x+1) #define M(x,y)((x+y)/2) typedef long long ll; typedef unsigned long long ull; using namespace std; vector<int> find_subset(int l,int r,vector<int> tt){ int n=sz(tt); pair<int,int> t[n]; for(int i=0;i<n;i++) t[i]={tt[i],i}; sort(t,t+n); vector<int> ans; ll a=0,b=0,sum=0; while(b<n){ sum+=t[b].F; while(sum>r){ sum-=t[a].F; a++; } if(sum>=l){ break; } b++; } if(b<n) for(int i=a;i<=b;i++) ans.PB(t[i].S); return ans; } /* int main(){ ios::sync_with_stdio(0); cin.tie(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...