Submission #1568069
Source Code Expand
#include <iostream> #include <iomanip> #include <vector> #include <algorithm> #include <cstring> #include <map> #include <queue> #include <cmath> #include <complex> // complex<double> a(1.2 , 2.3);// real(): 1.2, imag()2.3 using namespace std; #define MOD 1000000007 #define ll long long #define ld long double #define FOR(i,a,b) for(ll i=(ll)a;i<(ll)b;i++) #define rep(i,n) FOR(i,0,n) #define pb push_back #define mp make_pair #define all(a) a.begin(),a.end() #define rall(a) a.rbegin(),a.rend() #define rmsame(a) sort(all(a)),a.erase(unique(all(a)), a.end()) ll N; vector<ll> S,T; vector<ll> sum(100001); int main(){ cin.tie(0); ios::sync_with_stdio(false); cin >> N; rep(i,N){ ll si, ti; cin >> si >> ti; si--, ti--; S.pb(si); T.pb(ti); FOR(i,si,ti) sum[i]++; } ll MAX =0; vector<ll> check; rep(i,100001){ if(sum[i]==MAX) check.pb(i); if(sum[i]>MAX) {MAX=sum[i]; check.clear(); check.pb(i);} } //sort(all(check)); ll m = check[0]; ll M = check[check.size()-1]; rep(i,N){ if(S[i]<= m && M < T[i]){ cout << MAX-1 << endl; return 0; } } cout << MAX << endl; return 0; }
Submission Info
Submission Time | |
---|---|
Task | D - 足ゲームII |
User | ukohank517 |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 1217 Byte |
Status | TLE |
Exec Time | 2107 ms |
Memory | 4204 KB |
Judge Result
Set Name | Sample | All | ||||||
---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 100 | ||||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | sample-01.txt, sample-02.txt, sample-03.txt |
All | sample-01.txt, sample-02.txt, sample-03.txt, 01-01.txt, 01-02.txt, 01-03.txt, 01-04.txt, 01-05.txt, 01-06.txt, 01-07.txt, 01-08.txt, 01-09.txt, 01-10.txt, 01-11.txt, 01-12.txt, 01-13.txt, 01-14.txt, 01-15.txt, 01-16.txt, 01-17.txt, 01-18.txt, 01-19.txt, 01-20.txt, 01-21.txt, 01-22.txt, 01-23.txt, 01-24.txt, 01-25.txt, 01-26.txt, 01-27.txt, 01-28.txt, sample-01.txt, sample-02.txt, sample-03.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
01-01.txt | AC | 2 ms | 1660 KB |
01-02.txt | AC | 2 ms | 1660 KB |
01-03.txt | AC | 2 ms | 1280 KB |
01-04.txt | AC | 25 ms | 1024 KB |
01-05.txt | TLE | 2103 ms | 2804 KB |
01-06.txt | TLE | 2103 ms | 2804 KB |
01-07.txt | TLE | 2103 ms | 2804 KB |
01-08.txt | TLE | 2103 ms | 2804 KB |
01-09.txt | TLE | 2103 ms | 2804 KB |
01-10.txt | AC | 4 ms | 1152 KB |
01-11.txt | TLE | 2103 ms | 2804 KB |
01-12.txt | TLE | 2103 ms | 2804 KB |
01-13.txt | TLE | 2103 ms | 2804 KB |
01-14.txt | TLE | 2103 ms | 2804 KB |
01-15.txt | AC | 48 ms | 1152 KB |
01-16.txt | TLE | 2103 ms | 2804 KB |
01-17.txt | TLE | 2103 ms | 2804 KB |
01-18.txt | TLE | 2103 ms | 2804 KB |
01-19.txt | TLE | 2103 ms | 2804 KB |
01-20.txt | AC | 37 ms | 1152 KB |
01-21.txt | AC | 1716 ms | 2804 KB |
01-22.txt | AC | 1709 ms | 2804 KB |
01-23.txt | AC | 1711 ms | 2804 KB |
01-24.txt | TLE | 2107 ms | 1788 KB |
01-25.txt | AC | 3 ms | 2168 KB |
01-26.txt | AC | 2 ms | 1024 KB |
01-27.txt | AC | 19 ms | 4204 KB |
01-28.txt | AC | 19 ms | 4204 KB |
sample-01.txt | AC | 2 ms | 1024 KB |
sample-02.txt | AC | 2 ms | 1024 KB |
sample-03.txt | AC | 2 ms | 1024 KB |