Submission #2067160
Source Code Expand
#include <iostream> #include <iomanip> #include <string> #include <vector> #include <queue> #include <algorithm> #include <utility> #include <cmath> #include <map> #include <set> #include <stack> #include <cstdio> #include <cstdlib> #include <cstring> #include <cassert> #include <cctype> #include <complex> #include <functional> using namespace std; #define INF_LL (ll)1e18 #define INF (int)1e9 #define REP(i, n) for(int i = 0;i < (n);i++) #define FOR(i, a, b) for(int i = (a);i < (b);i++) #define all(x) x.begin(),x.end() #define fs first #define sc second using ll = long long; using PII = pair<int, int>; using PLL = pair<ll, ll>; using PIII = pair<int, PII>; const double eps = 1e-10; template<typename A, typename B>inline void chmin(A &a, B b){if(a > b) a = b;} template<typename A, typename B>inline void chmax(A &a, B b){if(a < b) a = b;} int main(void){ cin.tie(0); ios::sync_with_stdio(false); ll N, L; double x[114514] = {}; double dp[114514] = {}; fill(dp, dp+114514, INF); cin >> N >> L; REP(i, N){ cin >> x[i+1]; } x[N+1] = 2*INF; dp[0] = -L; REP(i, N){ if(x[i+1]-dp[i] <= L) continue; int in = upper_bound(x, x+N+1, L+x[i+1])-x; in--; if(x[in]-x[i+1] >= L) continue; chmin(dp[in], max(dp[i]+2*L, x[in]+0.1)); if(i == in) chmin(dp[i+1], x[i+1]+0.1); } if(dp[N] != INF) cout << "YES" << endl; else cout << "NO" << endl; }
Submission Info
Submission Time | |
---|---|
Task | C - ハードル走 |
User | maze1230 |
Language | C++14 (GCC 5.4.1) |
Score | 500 |
Code Size | 1442 Byte |
Status | AC |
Exec Time | 33 ms |
Memory | 2176 KB |
Judge Result
Set Name | Sample | Small | All | ||||||
---|---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 400 / 400 | 100 / 100 | ||||||
Status |
|
|
|
Set Name | Test Cases |
---|---|
Sample | 00_sample_06, 00_sample_part_00, 00_sample_part_01, 00_sample_part_02, 00_sample_part_03, 00_sample_part_04, 00_sample_part_05 |
Small | 00_sample_part_00, 00_sample_part_01, 00_sample_part_02, 00_sample_part_03, 00_sample_part_04, 00_sample_part_05, 50_random_NLsmall_part_00, 50_random_NLsmall_part_01, 50_random_NLsmall_part_02, 50_random_NLsmall_part_03, 50_random_NLsmall_part_04, 50_random_NLsmall_part_05, 50_random_NLsmall_part_06, 50_random_NLsmall_part_07, 50_random_NLsmall_part_08, 50_random_NLsmall_part_09, 50_random_XiNsmall_narrow_part_00, 50_random_XiNsmall_narrow_part_01, 50_random_XiNsmall_narrow_part_02, 50_random_XiNsmall_narrow_part_03, 50_random_XiNsmall_narrow_part_04, 50_random_XiNsmall_narrow_part_05, 50_random_XiNsmall_narrow_part_06, 50_random_XiNsmall_narrow_part_07, 50_random_XiNsmall_narrow_part_08, 50_random_XiNsmall_narrow_part_09, 50_random_XiNsmall_part_00, 50_random_XiNsmall_part_01, 50_random_XiNsmall_part_02, 50_random_XiNsmall_part_03, 50_random_XiNsmall_part_04, 50_random_XiNsmall_part_05, 50_random_XiNsmall_part_06, 50_random_XiNsmall_part_07, 50_random_XiNsmall_part_08, 50_random_XiNsmall_part_09, 50_random_x1small_part_00, 50_random_x1small_part_01, 50_random_x1small_part_02, 50_random_x1small_part_03, 50_random_x1small_part_04, 50_random_x1small_part_05, 50_random_x1small_part_06, 50_random_x1small_part_07, 50_random_x1small_part_08, 50_random_x1small_part_09, 80_hand_part_01, 80_hand_part_02, 80_hand_part_03, 80_hand_part_04, 80_hand_part_05, 80_hand_part_06, 80_hand_part_07, 80_hand_part_08, 80_hand_part_11, 80_hand_part_12, 98_challenge_part_00, 98_challenge_part_01, 98_challenge_part_02, 98_challenge_part_03, 98_challenge_part_04, 98_challenge_part_05 |
All | 00_sample_06, 00_sample_part_00, 00_sample_part_01, 00_sample_part_02, 00_sample_part_03, 00_sample_part_04, 00_sample_part_05, 50_random_NLsmall_part_00, 50_random_NLsmall_part_01, 50_random_NLsmall_part_02, 50_random_NLsmall_part_03, 50_random_NLsmall_part_04, 50_random_NLsmall_part_05, 50_random_NLsmall_part_06, 50_random_NLsmall_part_07, 50_random_NLsmall_part_08, 50_random_NLsmall_part_09, 50_random_XiNsmall_00, 50_random_XiNsmall_01, 50_random_XiNsmall_02, 50_random_XiNsmall_03, 50_random_XiNsmall_04, 50_random_XiNsmall_05, 50_random_XiNsmall_06, 50_random_XiNsmall_07, 50_random_XiNsmall_08, 50_random_XiNsmall_09, 50_random_XiNsmall_narrow_part_00, 50_random_XiNsmall_narrow_part_01, 50_random_XiNsmall_narrow_part_02, 50_random_XiNsmall_narrow_part_03, 50_random_XiNsmall_narrow_part_04, 50_random_XiNsmall_narrow_part_05, 50_random_XiNsmall_narrow_part_06, 50_random_XiNsmall_narrow_part_07, 50_random_XiNsmall_narrow_part_08, 50_random_XiNsmall_narrow_part_09, 50_random_XiNsmall_part_00, 50_random_XiNsmall_part_01, 50_random_XiNsmall_part_02, 50_random_XiNsmall_part_03, 50_random_XiNsmall_part_04, 50_random_XiNsmall_part_05, 50_random_XiNsmall_part_06, 50_random_XiNsmall_part_07, 50_random_XiNsmall_part_08, 50_random_XiNsmall_part_09, 50_random_Xilarge_00, 50_random_Xilarge_01, 50_random_Xilarge_02, 50_random_Xilarge_03, 50_random_Xilarge_04, 50_random_Xilarge_05, 50_random_Xilarge_06, 50_random_Xilarge_07, 50_random_Xilarge_08, 50_random_Xilarge_09, 50_random_Xilarge_narrow_00, 50_random_Xilarge_narrow_01, 50_random_Xilarge_narrow_02, 50_random_Xilarge_narrow_03, 50_random_Xilarge_narrow_04, 50_random_Xilarge_narrow_05, 50_random_Xilarge_narrow_06, 50_random_Xilarge_narrow_07, 50_random_Xilarge_narrow_08, 50_random_Xilarge_narrow_09, 50_random_x0small_00, 50_random_x0small_01, 50_random_x0small_02, 50_random_x0small_03, 50_random_x0small_04, 50_random_x0small_05, 50_random_x0small_06, 50_random_x0small_07, 50_random_x0small_08, 50_random_x0small_09, 50_random_x1small_part_00, 50_random_x1small_part_01, 50_random_x1small_part_02, 50_random_x1small_part_03, 50_random_x1small_part_04, 50_random_x1small_part_05, 50_random_x1small_part_06, 50_random_x1small_part_07, 50_random_x1small_part_08, 50_random_x1small_part_09, 80_hand_09, 80_hand_10, 80_hand_part_01, 80_hand_part_02, 80_hand_part_03, 80_hand_part_04, 80_hand_part_05, 80_hand_part_06, 80_hand_part_07, 80_hand_part_08, 80_hand_part_11, 80_hand_part_12, 90_max_no_00, 90_max_no_01, 90_max_yes_00, 90_max_yes_01, 98_challenge_part_00, 98_challenge_part_01, 98_challenge_part_02, 98_challenge_part_03, 98_challenge_part_04, 98_challenge_part_05 |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
00_sample_06 | AC | 2 ms | 2048 KB |
00_sample_part_00 | AC | 2 ms | 2048 KB |
00_sample_part_01 | AC | 2 ms | 2048 KB |
00_sample_part_02 | AC | 2 ms | 2048 KB |
00_sample_part_03 | AC | 2 ms | 2048 KB |
00_sample_part_04 | AC | 2 ms | 2048 KB |
00_sample_part_05 | AC | 2 ms | 2048 KB |
50_random_NLsmall_part_00 | AC | 2 ms | 2048 KB |
50_random_NLsmall_part_01 | AC | 2 ms | 2048 KB |
50_random_NLsmall_part_02 | AC | 2 ms | 2048 KB |
50_random_NLsmall_part_03 | AC | 2 ms | 2048 KB |
50_random_NLsmall_part_04 | AC | 2 ms | 2048 KB |
50_random_NLsmall_part_05 | AC | 2 ms | 2048 KB |
50_random_NLsmall_part_06 | AC | 2 ms | 2048 KB |
50_random_NLsmall_part_07 | AC | 2 ms | 2048 KB |
50_random_NLsmall_part_08 | AC | 2 ms | 2048 KB |
50_random_NLsmall_part_09 | AC | 2 ms | 2048 KB |
50_random_XiNsmall_00 | AC | 2 ms | 2048 KB |
50_random_XiNsmall_01 | AC | 2 ms | 2048 KB |
50_random_XiNsmall_02 | AC | 2 ms | 2048 KB |
50_random_XiNsmall_03 | AC | 2 ms | 2048 KB |
50_random_XiNsmall_04 | AC | 2 ms | 2048 KB |
50_random_XiNsmall_05 | AC | 2 ms | 2048 KB |
50_random_XiNsmall_06 | AC | 2 ms | 2048 KB |
50_random_XiNsmall_07 | AC | 2 ms | 2048 KB |
50_random_XiNsmall_08 | AC | 2 ms | 2048 KB |
50_random_XiNsmall_09 | AC | 2 ms | 2048 KB |
50_random_XiNsmall_narrow_part_00 | AC | 2 ms | 2048 KB |
50_random_XiNsmall_narrow_part_01 | AC | 2 ms | 2048 KB |
50_random_XiNsmall_narrow_part_02 | AC | 2 ms | 2048 KB |
50_random_XiNsmall_narrow_part_03 | AC | 2 ms | 2048 KB |
50_random_XiNsmall_narrow_part_04 | AC | 2 ms | 2048 KB |
50_random_XiNsmall_narrow_part_05 | AC | 2 ms | 2048 KB |
50_random_XiNsmall_narrow_part_06 | AC | 2 ms | 2048 KB |
50_random_XiNsmall_narrow_part_07 | AC | 2 ms | 2048 KB |
50_random_XiNsmall_narrow_part_08 | AC | 2 ms | 2048 KB |
50_random_XiNsmall_narrow_part_09 | AC | 2 ms | 2048 KB |
50_random_XiNsmall_part_00 | AC | 2 ms | 2048 KB |
50_random_XiNsmall_part_01 | AC | 2 ms | 2048 KB |
50_random_XiNsmall_part_02 | AC | 2 ms | 2048 KB |
50_random_XiNsmall_part_03 | AC | 2 ms | 2048 KB |
50_random_XiNsmall_part_04 | AC | 2 ms | 2048 KB |
50_random_XiNsmall_part_05 | AC | 2 ms | 2048 KB |
50_random_XiNsmall_part_06 | AC | 2 ms | 2048 KB |
50_random_XiNsmall_part_07 | AC | 2 ms | 2048 KB |
50_random_XiNsmall_part_08 | AC | 2 ms | 2048 KB |
50_random_XiNsmall_part_09 | AC | 2 ms | 2048 KB |
50_random_Xilarge_00 | AC | 10 ms | 2048 KB |
50_random_Xilarge_01 | AC | 6 ms | 2048 KB |
50_random_Xilarge_02 | AC | 26 ms | 2048 KB |
50_random_Xilarge_03 | AC | 13 ms | 2048 KB |
50_random_Xilarge_04 | AC | 6 ms | 2048 KB |
50_random_Xilarge_05 | AC | 28 ms | 2048 KB |
50_random_Xilarge_06 | AC | 8 ms | 2048 KB |
50_random_Xilarge_07 | AC | 27 ms | 2176 KB |
50_random_Xilarge_08 | AC | 19 ms | 2048 KB |
50_random_Xilarge_09 | AC | 17 ms | 2048 KB |
50_random_Xilarge_narrow_00 | AC | 27 ms | 2048 KB |
50_random_Xilarge_narrow_01 | AC | 25 ms | 2048 KB |
50_random_Xilarge_narrow_02 | AC | 8 ms | 2048 KB |
50_random_Xilarge_narrow_03 | AC | 10 ms | 2048 KB |
50_random_Xilarge_narrow_04 | AC | 8 ms | 2048 KB |
50_random_Xilarge_narrow_05 | AC | 24 ms | 2048 KB |
50_random_Xilarge_narrow_06 | AC | 13 ms | 2048 KB |
50_random_Xilarge_narrow_07 | AC | 8 ms | 2048 KB |
50_random_Xilarge_narrow_08 | AC | 19 ms | 2048 KB |
50_random_Xilarge_narrow_09 | AC | 13 ms | 2048 KB |
50_random_x0small_00 | AC | 18 ms | 2048 KB |
50_random_x0small_01 | AC | 10 ms | 2048 KB |
50_random_x0small_02 | AC | 22 ms | 2048 KB |
50_random_x0small_03 | AC | 24 ms | 2048 KB |
50_random_x0small_04 | AC | 14 ms | 2048 KB |
50_random_x0small_05 | AC | 26 ms | 2048 KB |
50_random_x0small_06 | AC | 7 ms | 2048 KB |
50_random_x0small_07 | AC | 24 ms | 2048 KB |
50_random_x0small_08 | AC | 27 ms | 2048 KB |
50_random_x0small_09 | AC | 18 ms | 2048 KB |
50_random_x1small_part_00 | AC | 2 ms | 2048 KB |
50_random_x1small_part_01 | AC | 2 ms | 2048 KB |
50_random_x1small_part_02 | AC | 2 ms | 2048 KB |
50_random_x1small_part_03 | AC | 2 ms | 2048 KB |
50_random_x1small_part_04 | AC | 2 ms | 2048 KB |
50_random_x1small_part_05 | AC | 2 ms | 2048 KB |
50_random_x1small_part_06 | AC | 2 ms | 2048 KB |
50_random_x1small_part_07 | AC | 2 ms | 2048 KB |
50_random_x1small_part_08 | AC | 2 ms | 2048 KB |
50_random_x1small_part_09 | AC | 2 ms | 2048 KB |
80_hand_09 | AC | 3 ms | 2048 KB |
80_hand_10 | AC | 3 ms | 2048 KB |
80_hand_part_01 | AC | 2 ms | 2048 KB |
80_hand_part_02 | AC | 2 ms | 2048 KB |
80_hand_part_03 | AC | 2 ms | 2048 KB |
80_hand_part_04 | AC | 2 ms | 2048 KB |
80_hand_part_05 | AC | 2 ms | 2048 KB |
80_hand_part_06 | AC | 2 ms | 2048 KB |
80_hand_part_07 | AC | 2 ms | 2048 KB |
80_hand_part_08 | AC | 2 ms | 2048 KB |
80_hand_part_11 | AC | 2 ms | 2048 KB |
80_hand_part_12 | AC | 2 ms | 2048 KB |
90_max_no_00 | AC | 30 ms | 2048 KB |
90_max_no_01 | AC | 30 ms | 2048 KB |
90_max_yes_00 | AC | 33 ms | 2048 KB |
90_max_yes_01 | AC | 33 ms | 2048 KB |
98_challenge_part_00 | AC | 2 ms | 2048 KB |
98_challenge_part_01 | AC | 2 ms | 2048 KB |
98_challenge_part_02 | AC | 2 ms | 2048 KB |
98_challenge_part_03 | AC | 2 ms | 2048 KB |
98_challenge_part_04 | AC | 2 ms | 2048 KB |
98_challenge_part_05 | AC | 2 ms | 2048 KB |