제출 #995720

#제출 시각아이디문제언어결과실행 시간메모리
995720kokoueDetecting Molecules (IOI16_molecules)C++14
69 / 100
34 ms4156 KiB
#include<bits/stdc++.h> #define maxn 1000000 using namespace std; //set<long long> is; unordered_map<int,bool> is; unordered_map<long long,long long> idx; vector<int> find_subset(int l,int u,vector<int> w) { int n=w.size(); is[0]=1; idx[0]=0; int sum=0; bool fl=0; int mx=0; vector<pair<int,int>> a; for(int i=0;i<n;i++) a.push_back({w[i],i}); sort(a.begin(),a.end()); vector<int> res; int ll=0,r=0; for(int i=0;i<n;i++) { sum+=a[i].first; while(sum>u) { sum-=a[ll].first; ll++; } if(l<=sum && sum<=u) { for(int j=ll;j<=i;j++) res.push_back(a[j].second); return res; } } res.clear(); return res; }

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

molecules.cpp: In function 'std::vector<int> find_subset(int, int, std::vector<int>)':
molecules.cpp:13:10: warning: unused variable 'fl' [-Wunused-variable]
   13 |     bool fl=0;
      |          ^~
molecules.cpp:14:9: warning: unused variable 'mx' [-Wunused-variable]
   14 |     int mx=0;
      |         ^~
molecules.cpp:19:14: warning: unused variable 'r' [-Wunused-variable]
   19 |     int ll=0,r=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...