제출 #206358

#제출 시각아이디문제언어결과실행 시간메모리
206358autumn_eelDetecting Molecules (IOI16_molecules)C++14
69 / 100
1095 ms3888 KiB
#include <bits/stdc++.h> #define rep(i,n)for(int i=0;i<(n);i++) #include "molecules.h" using namespace std; typedef long long ll; typedef pair<int,int>P; std::vector<int> find_subset(int l, int u, std::vector<int> w) { vector<int>v; for(int i:w)v.push_back(i); sort(v.begin(),v.end()); ll Min=0,Max=0; rep(i,v.size()){ Min+=v[i]; Max+=v[v.size()-i-1]; if(Min<=u&&l<=Max){ multiset<int>se; for(int j=0;j<=i;j++)se.insert(v[j]); ll sum=Min; if(sum<l){ for(int j=i+1;j<v.size();j++){ int del=v[j]-*se.begin(); se.erase(se.begin()); se.insert(v[j]); sum+=del; if(l<=sum)break; } } assert(sum<=u); vector<int>ans; rep(i,w.size()){ if(se.count(w[i])){ se.erase(se.find(w[i])); ans.push_back(i); } } return ans; } } return {}; }

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

molecules.cpp: In function 'std::vector<int> find_subset(int, int, std::vector<int>)':
molecules.cpp:2:30: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
 #define rep(i,n)for(int i=0;i<(n);i++)
                              ^
molecules.cpp:13:2: note: in expansion of macro 'rep'
  rep(i,v.size()){
  ^~~
molecules.cpp:21:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(int j=i+1;j<v.size();j++){
                   ~^~~~~~~~~
molecules.cpp:2:30: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
 #define rep(i,n)for(int i=0;i<(n);i++)
                              ^
molecules.cpp:31:4: note: in expansion of macro 'rep'
    rep(i,w.size()){
    ^~~
#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...