답안 #889162

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
889162 2023-12-19T04:06:17 Z Ghulam_Junaid Roller Coaster Railroad (IOI16_railroad) C++17
0 / 100
159 ms 22212 KB
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;

ll plan_roller_coaster (vector<int> s, vector<int> t){
    ll n = s.size();

    set<vector<int>> st;
    for (int i=0; i<n; i++)
        st.insert({s[i], t[i], i});

    vector<int> last = {1, -1, -1};
    ll can = 1;
    while (st.size()){
        auto lb = st.lower_bound(last);
        if (lb == st.end()){
            can = 0;
            break;
        }

        last = *lb;
        swap(last[0], last[1]);
        last[1] = -1;
        last[2] = -1;

        st.erase(lb);
    }

    return can;
}

// int main(){
//     return 0;
// }
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 344 KB answer is not correct: 1 instead of 0
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 344 KB answer is not correct: 1 instead of 0
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 159 ms 22212 KB answer is not correct: 1 instead of 0
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 344 KB answer is not correct: 1 instead of 0
2 Halted 0 ms 0 KB -