#include<bits/stdc++.h>
using namespace std;
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
tree<int,null_type,greater<int>,rb_tree_tag,tree_order_statistics_node_update>st;
#include "books.h"
//#include"grader.cpp"
long long minimum_walk(vector<int> p, int s) {
st.clear();
long long res=0,mx=0;
for(auto&x:p){
int temp=2*st.order_of_key(x);
if(temp)mx=max(mx,1LL*x);
res+=temp;
st.insert(x);
}
res+=mx*2;
return res;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Incorrect |
1 ms |
340 KB |
3rd lines differ - on the 1st token, expected: '6', found: '10' |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Incorrect |
1 ms |
340 KB |
3rd lines differ - on the 1st token, expected: '6', found: '10' |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Incorrect |
1 ms |
340 KB |
3rd lines differ - on the 1st token, expected: '6', found: '10' |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
340 KB |
3rd lines differ - on the 1st token, expected: '3304', found: '6860' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Incorrect |
1 ms |
340 KB |
3rd lines differ - on the 1st token, expected: '6', found: '10' |
3 |
Halted |
0 ms |
0 KB |
- |