Submission #108175

# Submission time Handle Problem Language Result Execution time Memory
108175 2019-04-27T20:52:10 Z reda Detecting Molecules (IOI16_molecules) C++14
0 / 100
3 ms 384 KB
#include<bits/stdc++.h>
#define MOD 1000000007
#define mp make_pair
using namespace std;
 vector<int>v(0) ;

vector<int> find_subset(int l, int u, vector<int> w){
     int n=w.size();
     vector<int>r;
 sort(w.begin(),w.end());
 int arr[n][n];
vector<pair<int,pair<int,int>>> m;
   for(int i=0;i<n;i++) arr[i][i]=0;
    for(int i=0;i<n;i++)
        for(int j=0;j<n;j++)
        arr[i][j]=w[i]-w[j];

      for(int i=0;i<n;i++)
        for(int j=0;j<n;j++)
        {
            if(arr[i][j]<=u-l)
                m.push_back(mp(arr[i][j],mp(i,j)));
        }
    sort(m.begin(),m.end());
    reverse(m.begin(),m.end());
    int k = m[0].first;
    int beg = m[0].second.first;
    int en = m[0].second.second;
    if (m.size()==0)return v;
    for(int i=beg;i<=en;i++)
    {
        r.push_back(w[i]);
    }
    return r;
}

Compilation message

molecules.cpp: In function 'std::vector<int> find_subset(int, int, std::vector<int>)':
molecules.cpp:26:9: warning: unused variable 'k' [-Wunused-variable]
     int k = m[0].first;
         ^
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 384 KB Integer 9 violates the range [0, 0]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 384 KB Contestant can not find answer, jury can
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 384 KB Integer 9 violates the range [0, 0]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 384 KB Integer 9 violates the range [0, 0]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 384 KB Integer 9 violates the range [0, 0]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 384 KB Integer 9 violates the range [0, 0]
2 Halted 0 ms 0 KB -