제출 #299359

#제출 시각아이디문제언어결과실행 시간메모리
299359APROHACKDetecting Molecules (IOI16_molecules)C++14
0 / 100
1 ms256 KiB
#include "molecules.h" #include <bits/stdc++.h> #define PB push_back using namespace std; vector<int> find_subset(int l, int u, vector<int> w) { vector<int>respuesta; sort(w.begin(), w.end()); long long sum=0, n=w.size(); long long menor=w[0], mayor=w[n-1], nn=0, mm=0; for(int i = 0 ; i < n ; i ++){ if(w[i]==menor)nn++; else mm++; } for(int i = 0 ; i <= nn ; i ++){ for(int j = 0 ; j <= mm ; j++){ if(i*menor+j*mayor>=l&&i*menor+j*mayor<=u){ for(int x = 0 ; x < nn ; x ++){ respuesta.push_back(x); } for(int x = n-1 ; x >(n-1)-mm ; x --){ respuesta.push_back(x); } return respuesta; } } } return respuesta; //return std::vector<int>respuesta; }

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

molecules.cpp: In function 'std::vector<int> find_subset(int, int, std::vector<int>)':
molecules.cpp:8:12: warning: unused variable 'sum' [-Wunused-variable]
    8 |  long long sum=0, n=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...