제출 #878274

#제출 시각아이디문제언어결과실행 시간메모리
878274HuyQuang_re_ZeroDetecting Molecules (IOI16_molecules)C++14
100 / 100
42 ms9772 KiB
#include <bits/stdc++.h> #define ll long long #define db long double #define II pair <ll,ll> #define III pair <ll,II> #define IV pair <vector <int>,vector <int> > #define TII pair <treap*,treap*> #define fst first #define snd second #define BIT(x,i) ((x>>i)&1) #define pi acos(-1) #define to_radian(x) (x*pi/180.0) #define to_degree(x) (x*180.0/pi) #define Log(x) (31-__builtin_clz((int)x)) #define LogLL(x) (63-__builtin_clzll((ll)x)) using namespace std; #include "molecules.h" vector<int> find_subset(int l,int r,vector<int> vec) { vector <II> a; vector <int> res; for(int x:vec) { int tg=a.size(); a.push_back({ x,tg }); } sort(a.begin(),a.end()); ll sum=0,j=0; for(int i=0;i<a.size();i++) { sum+=a[i].fst; while(sum>r) sum-=a[j++].fst; if(sum>=l) { for(int k=j;k<=i;k++) res.push_back(a[k].snd); return res; } } return res; } /* int main() { freopen("molecules.inp","r",stdin); freopen("molecules.out","w",stdout); int l,r,x; vector <int> vec; cin>>l>>r; while(cin>>x) vec.push_back(x); vector <int> res=find_subset(l,r,vec); for(int x:res) cout<<x<<" "; } */

컴파일 시 표준 에러 (stderr) 메시지

molecules.cpp: In function 'std::vector<int> find_subset(int, int, std::vector<int>)':
molecules.cpp:30:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<long long int, long long int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   30 |     for(int i=0;i<a.size();i++)
      |                 ~^~~~~~~~~
#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...