Submission #962964

#TimeUsernameProblemLanguageResultExecution timeMemory
962964amine_arouaRoller Coaster Railroad (IOI16_railroad)C++17
0 / 100
46 ms5084 KiB
#include <bits/stdc++.h> using namespace std; #define fore(i , n) for(int i = 0 ; i<n;i++) #define forr(i , x , y) for(int i = x; i<=y;i++) #define forn(i , x , y) for(int i = x ; i>=y;i--) #define vi vector<int> #define vii vector<pair<int ,int>> #define pb push_back #define lint long long #define sz(s) (int)s.size() #define all(v) v.begin() , v.end() #define nl '\n' lint plan_roller_coaster(vi s , vi t) { int n = sz(s); vii v(n); fore(i , n) { v[i] = {s[i] , t[i]}; } sort(all(v)); fore(i , n) { s[i] = v[i].first ; t[i] = v[i].second; } int acc = 1; fore(i , n - 1) { if(!(s[i] <= t[i] && t[i] <= s[i + 1])) { acc = 0; break; } } if((s[n - 1] > t[n - 1])) acc = 0; return 1 - acc; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...