Submission #90912

#TimeUsernameProblemLanguageResultExecution timeMemory
90912RakhmandUntitled (POI11_tem)C++14
8 / 100
234 ms33792 KiB
#include <cstring> #include <vector> #include <list> #include <map> #include <set> #include <deque> #include <stack> #include <bitset> #include <algorithm> #include <functional> #include <numeric> #include <utility> #include <sstream> #include <iostream> #include <iomanip> #include <cstdio> #include <queue> #include <cmath> #include <cstdlib> #include <ctime> #include <cassert> #define ios ios_base::sync_with_stdio(0), cout.tie(0), cin.tie(0); #define S second #define F first #define pb push_back #define nl '\n' #define mp make_pair #define NL cout << '\n'; #define EX exit(0) #define all(s) s.begin(), s.end() #define ll long long #define lp(i, start, finish) for(int i = start; i <= finish; i++) #define y1 ljdalsdfjak const long long MXN = 1e6 + 1; const long long MNN = 3 * 1e3 + 1; const long long MOD = 1e9 + 7; const long long INF = 1e16 + 1; const long long OO = 1e15; typedef long long llong; typedef unsigned long long ullong; using namespace std; llong n, b[MXN], cnt = 1, mx; pair<int, int> p[MXN]; int main(){ ios; cin >> n; for(int i = 1; i <= n; i++){ cin >> p[i].F >> p[i].S; }b[1] = p[1].F; for(int i = 2; i <= n; i++){ if(p[i].F <= b[i - 1]){ if(b[i - 1] <= p[i].S){ b[i] = b[i - 1]; }else{ b[i] = p[i].F; } }else{ b[i] = p[i].F; } }for(int i = 1; i <= n; i++){ if(b[i - 1] <= b[i]){ cnt++; }else{ mx = max(cnt, mx); cnt = 1; } }cout << mx; 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...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...