Submission #172087

#TimeUsernameProblemLanguageResultExecution timeMemory
172087arnold518Roller Coaster Railroad (IOI16_railroad)C++14
0 / 100
96 ms10544 KiB
#include "railroad.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; const int MAXN = 2e5; struct Data { ll s, t; }; int N; Data A[MAXN+10]; ll plan_roller_coaster(vector<int> _S, vector<int> _T) { int i, j; N=_S.size(); for(i=1; i<=N; i++) A[i]={_S[i-1], _T[i-1]}; sort(A+1, A+N+1, [&](const Data &p, const Data &q) { return p.t<q.t; }); for(i=1; i<N; i++) if(A[i].t>A[i+1].s) return 0; return 1; }

Compilation message (stderr)

railroad.cpp: In function 'll plan_roller_coaster(std::vector<int>, std::vector<int>)':
railroad.cpp:21:12: warning: unused variable 'j' [-Wunused-variable]
     int i, j;
            ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...