Submission #572453

# Submission time Handle Problem Language Result Execution time Memory
572453 2022-06-04T12:14:49 Z srlabib Detecting Molecules (IOI16_molecules) C++17
0 / 100
0 ms 212 KB
#/****Bismillahir rahmanir rahim****/

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<long long> vl;
typedef vector<double> vd;

#define All(a) a.begin(), a.end()

template <typename T>
void get_vector(T &a)
{
    for (auto &e : a)
        cin >> e;
}

template <typename T>
void put_vector(T a)
{
    for (auto e : a)
        cout << e << " ";
    cout << endl;
}

vector<int> find_subset(int l, int u, vi w)
{
    int n =w.size();
    vector<pair<int,int>> a(n);
    for(int i = 0; i<n ; i++){
        a[i] = {w[i],i+1};
    }
    sort(All(a));
    for(auto e: a){
        cout<< e.first<<" " <<e.second<<endl;
    }
    ll sum = 0;
    int i;
    for(i = 0; i<n; i++){
        sum += a[i].first;
        if(sum>=l)break;
    }
    cout<<i<<endl;
    if(sum>u)return {};
    vi res(i+1);
    for(int j = 0; j<=i; j++){
        res[j] = a[i].second;
    }
    return res;
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Secret is incorrect!
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Secret is incorrect!
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Secret is incorrect!
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Secret is incorrect!
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Secret is incorrect!
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Secret is incorrect!
2 Halted 0 ms 0 KB -