Submission #229259

# Submission time Handle Problem Language Result Execution time Memory
229259 2020-05-03T23:54:21 Z nickmet2004 Detecting Molecules (IOI16_molecules) C++11
0 / 100
5 ms 256 KB
#include<bits/stdc++.h>
#include<molecules.h>

#define ll long long

using namespace std;

set<pair<ll,ll> >s;
vector<int> find_subset(int l , int u , vector<int> w){
    s.insert({w[0] , 0});
    ll cur = w[0];
    int n = w.size();
    for(int i = 1; i < n; ++i){
        s.insert({w[i] + cur , i});
        cur += w[i];
    }
    int ansi = -1 , ansj = -1;
        for(auto it = s.begin(); it != s.end(); ++it){
        ll pr = it->first;
        int i = it->second;
        auto E = s.lower_bound({pr - l , -1});
        if(E->second < i){
            if(pr - E->first >= l && pr - E->first <= u){
                ansi = E->first; ansj = i;
                break;
            }
        }
        --E;
        if(pr - E->first >= l && pr - E->first <= u){
            ansi = E->second; ansj = i;
            break;
        }
    }ansi++;
    vector<int> result;
    if(ansi == -1 && ansj == -1) return result;
    for(int i = ansi; i <= ansj; ++i){
        result.emplace_back(w[i]);
    }
    return result;
}
/*
set<pair<ll,ll> >s;
int main (){
    ios_base::sync_with_stdio(0); cin.tie(0);
    ll n , l , r;
    cin >> n >> l >> r;
    int cur; cin >> cur;
    s.insert({cur , 0});
    for(int i = 1; i < n; ++i){
        ll x;
        cin >> x;
        s.insert({x + cur , i});
        cur += x;
    }
    int ansi = -1 , ansj = -1;
        for(auto it = s.begin(); it != s.end(); ++it){
        ll pr = it->first;
        int i = it->second;
        auto E = s.lower_bound({pr - l , -1});
        if(E->second < i){
            if(pr - E->first >= l && pr - E->first <= r){
                ansi = E->first; ansj = i;
                break;
            }
        }
        --E;
        if(pr - E->first >= l && pr - E->first <= r){
            ansi = E->second; ansj = i;
            break;
        }
    }ansi++;
    cout << ansi << " " << ansj << endl;
}
*/
# Verdict Execution time Memory Grader output
1 Correct 5 ms 256 KB OK (n = 1, answer = NO)
2 Correct 5 ms 256 KB OK (n = 1, answer = NO)
3 Incorrect 5 ms 256 KB Contestant can not find answer, jury can
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 256 KB Contestant can not find answer, jury can
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 5 ms 256 KB OK (n = 1, answer = NO)
2 Correct 5 ms 256 KB OK (n = 1, answer = NO)
3 Incorrect 5 ms 256 KB Contestant can not find answer, jury can
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 5 ms 256 KB OK (n = 1, answer = NO)
2 Correct 5 ms 256 KB OK (n = 1, answer = NO)
3 Incorrect 5 ms 256 KB Contestant can not find answer, jury can
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 5 ms 256 KB OK (n = 1, answer = NO)
2 Correct 5 ms 256 KB OK (n = 1, answer = NO)
3 Incorrect 5 ms 256 KB Contestant can not find answer, jury can
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 5 ms 256 KB OK (n = 1, answer = NO)
2 Correct 5 ms 256 KB OK (n = 1, answer = NO)
3 Incorrect 5 ms 256 KB Contestant can not find answer, jury can
4 Halted 0 ms 0 KB -