제출 #872509

#제출 시각아이디문제언어결과실행 시간메모리
872509karimovDetecting Molecules (IOI16_molecules)C++17
19 / 100
1 ms388 KiB
#include <bits/stdc++.h> using namespace std; #define pb push_back vector<int> find_subset(int l, int u, vector<int> w) { int n = w.size(); int left=1,right=1; vector<long long> arr(n+1); arr[0]=0; for(int i = 1; i <= n; i++) { arr[i] = arr[i-1]+w[i-1]; } vector<int>ans; while(right <= n) { long long x = arr[right]-arr[left-1]; // cout << x << endl; if(x < l)right++; else if(x > u)left++; if(x >= l && x <= u) { for(int i = left-1; i < right; i++) { ans.pb(i); } break; } if(left > right)right++; } return ans; }
#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...