## Submission #162578

# Submission time Handle Problem Language Result Execution time Memory
0 / 100
960 ms 19940 KB
```#include <bits/stdc++.h>

using namespace std ;

vector<int>a , b ;
int n ;

vector< pair<int , int> >vp ;

bool solve(pair<int , int>p)
{
set< pair<int , int> >s ;
set< pair<int , int> >::iterator it ;
for(int i = 0 ; i < n ; ++i)
s.insert(vp[i]) ;
for(int i = 0 ; i < n-1 ; ++i)
{
s.erase(p) ;
it = s.lower_bound({p.second , -1}) ;
if(it == s.end())
return 0 ;
p = *it ;
}
return 1 ;
}

long long plan_roller_coaster(std::vector<int> s, std::vector<int> t) {
n = (int) s.size();
a = s , b = t ;
for(int i = 0 ; i < n ; ++i)
vp.push_back({a[i] , b[i]}) ;
sort(vp.begin() , vp.end()) ;
for(int i = 0 ; i < 10 ; ++i)
{
if(solve(vp[i]) == 1)
return 0 ;
}
return 1 ;
}
```

#### Subtask #1 0 / 11.0

# Verdict Execution time Memory Grader output
1 Correct 2 ms 376 KB n = 2
2 Correct 2 ms 256 KB n = 2
3 Correct 2 ms 256 KB n = 2
4 Correct 2 ms 256 KB n = 2
5 Correct 2 ms 256 KB n = 2
6 Incorrect 2 ms 376 KB answer is not correct: 0 instead of 523688153
7 Halted 0 ms 0 KB -

#### Subtask #2 0 / 23.0

# Verdict Execution time Memory Grader output
1 Correct 2 ms 376 KB n = 2
2 Correct 2 ms 256 KB n = 2
3 Correct 2 ms 256 KB n = 2
4 Correct 2 ms 256 KB n = 2
5 Correct 2 ms 256 KB n = 2
6 Incorrect 2 ms 376 KB answer is not correct: 0 instead of 523688153
7 Halted 0 ms 0 KB -

#### Subtask #3 0 / 30.0

# Verdict Execution time Memory Grader output
1 Correct 194 ms 19308 KB n = 199999
2 Correct 960 ms 19864 KB n = 199991
3 Correct 644 ms 19940 KB n = 199993
4 Correct 180 ms 14952 KB n = 152076
5 Correct 110 ms 9452 KB n = 93249
6 Incorrect 759 ms 18804 KB answer is not correct: 1 instead of 0
7 Halted 0 ms 0 KB -

#### Subtask #4 0 / 36.0

# Verdict Execution time Memory Grader output
1 Correct 2 ms 376 KB n = 2
2 Correct 2 ms 256 KB n = 2
3 Correct 2 ms 256 KB n = 2
4 Correct 2 ms 256 KB n = 2
5 Correct 2 ms 256 KB n = 2
6 Incorrect 2 ms 376 KB answer is not correct: 0 instead of 523688153
7 Halted 0 ms 0 KB -