Submission #737801

#TimeUsernameProblemLanguageResultExecution timeMemory
737801Elvin_FritlDetecting Molecules (IOI16_molecules)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; #include "molecules.h" vector<int> find_subset(int l, int u, vector<int> w){ int toto=u-l; vector<pair<int,int>>m; vector<int>res; for(int i=0;i<w.size();i++){ m.push_back({w[i],i}); } sort(m.begin(),m.end()); for(int i=0;i<w.size()-1;i++){ if(abs(m[i].first - m[i+1].first)<=toto){ res.push_back(m[i].second); res.push_back(m[i+1].second); break; } } return vector<int>ress(0); }

Compilation message (stderr)

molecules.cpp: In function 'std::vector<int> find_subset(int, int, std::vector<int>)':
molecules.cpp:9:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    9 |     for(int i=0;i<w.size();i++){
      |                 ~^~~~~~~~~
molecules.cpp:13:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   13 |     for(int i=0;i<w.size()-1;i++){
      |                 ~^~~~~~~~~~~
molecules.cpp:20:23: error: expected primary-expression before 'ress'
   20 |     return vector<int>ress(0);
      |                       ^~~~
molecules.cpp:20:23: error: expected ';' before 'ress'
   20 |     return vector<int>ress(0);
      |                       ^~~~
      |                       ;
molecules.cpp:20:23: error: 'ress' was not declared in this scope; did you mean 'res'?
   20 |     return vector<int>ress(0);
      |                       ^~~~
      |                       res