Submission #561356

# Submission time Handle Problem Language Result Execution time Memory
561356 2022-05-12T16:59:07 Z neki Roller Coaster Railroad (IOI16_railroad) C++14
0 / 100
92 ms 10388 KB
#include <bits/stdc++.h>
#define vc vector
#define ll long long
using namespace std;

ll plan_roller_coaster(vc<int> s, vc<int> t) {
    
    s.push_back(1000000100);t.push_back(1);
    ll n=s.size();
    vc<ll> ind(n); iota(ind.begin(), ind.end(), 0);
    sort(ind.begin(), ind.end(), [&](ll a, ll b){return s[a]<s[b];});
    
    
    vc<ll> kok(n, 0);
    sort(t.begin(), t.end());
    for(ll i=0, j=0;i<n;++i){
        while(j<n and t[i]>s[ind[j]]) j++;
        if(j<n) ++kok[j];
    }
    
    for(ll i=1;i<n;++i) kok[i]+=kok[i-1];
    
    ll br=1;
    for(ll i=0;i<n;++i) if(kok[i]>=i+1) br=0;
    return br;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB n = 2
2 Correct 1 ms 212 KB n = 2
3 Correct 1 ms 212 KB n = 2
4 Correct 1 ms 212 KB n = 2
5 Correct 1 ms 212 KB n = 2
6 Incorrect 1 ms 212 KB answer is not correct: 0 instead of 523688153
7 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB n = 2
2 Correct 1 ms 212 KB n = 2
3 Correct 1 ms 212 KB n = 2
4 Correct 1 ms 212 KB n = 2
5 Correct 1 ms 212 KB n = 2
6 Incorrect 1 ms 212 KB answer is not correct: 0 instead of 523688153
7 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 81 ms 10388 KB n = 199999
2 Incorrect 92 ms 10384 KB answer is not correct: 0 instead of 1
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB n = 2
2 Correct 1 ms 212 KB n = 2
3 Correct 1 ms 212 KB n = 2
4 Correct 1 ms 212 KB n = 2
5 Correct 1 ms 212 KB n = 2
6 Incorrect 1 ms 212 KB answer is not correct: 0 instead of 523688153
7 Halted 0 ms 0 KB -