Submission #103030

#TimeUsernameProblemLanguageResultExecution timeMemory
103030Osama_AlkhodairyRoller Coaster Railroad (IOI16_railroad)C++17
0 / 100
571 ms25072 KiB
#include <bits/stdc++.h> #include "railroad.h" using namespace std; #define ll long long map <int, int> m; long long plan_roller_coaster(std::vector<int> s, std::vector<int> t) { s.push_back(1e9); t.push_back(1); int n = s.size(); for(int i = 0 ; i < n ; i++){ int l = s[i], r = t[i]; if(l > r) swap(l, r); if(l == r) assert(false); if(s[i] < t[i]) m[l]++, m[r]--; else m[l]--, m[r]++; } int sum = 0; for(auto &i : m){ sum += i.second; if(sum > 0) return 1; } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...