Submission #2069570


Source Code Expand

/*
cat <<EOF >mistaken-paste
*/

#pragma GCC diagnostic ignored "-Wincompatible-pointer-types"

#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
#include <math.h>

#define BIG 2000000007
#define VERYBIG 200000000000007LL

#define MOD 1000000007
typedef uint64_t ull;
typedef  int64_t sll;

#define N_MAX 300000
#define M_MAX 100000

#ifdef __cplusplus
#include <queue>
#include <stack>
// #include <tuple>
#include <functional>

using namespace std; // I'm NOT gonna use C++ without compro. shit

typedef priority_queue<ull, vector<ull>, greater<ull> > upque123;
typedef priority_queue<ull, vector<ull> > upque321;
typedef priority_queue<sll, vector<sll>, greater<sll> > spque123;
typedef priority_queue<sll, vector<sll> > spque321;

#endif

typedef struct {
	int32_t a;
	int32_t b;
} hw;

typedef struct {
	sll a;
	sll b;
} hwll;

typedef struct {
	hwll a;
	hwll b;
} linell;


typedef struct {
	ull s;
	ull t;
	int32_t c;
} struct_a;

typedef struct {
	int32_t from;
	int32_t to;
	sll cost;
} struct_b;



const hw vector8[8] = {
	{-1, -1},
	{-1,  0},
	{-1, +1},
	{ 0, -1},
	{ 0, +1},
	{+1, -1},
	{+1,  0},
	{+1, +1}
};

ull n, m;
ull h, w;
ull k;
ull q;
ull vua, vub, vuc, vud, vue, vuf;
sll vsa, vsb, vsc, vsd, vse, vsf;
long double vra, vrb, vrc;
double vda, vdb, vdc;
size_t slen;
size_t tlen;
char ch, dh;

ull umax (ull x, ull y) {
	return (x > y) ? x : y;
}

ull a[N_MAX];

ull solve () {
	sll i, j, ki;

	ull running = 0;
	i = 0;
	while (i < n) {
		j = i;
		while (j < n - 1 && a[j + 1] - a[i] < k) j++;
		ull reachgroundafter = umax(a[j], running + k);
		if (j < n - 1 && a[j + 1] <= reachgroundafter + k) goto fail;

		running = reachgroundafter + k;
		i = j + 1;

	}
	goto success;

	success:
	puts("YES");
	return 0;

	fail:
	puts("NO");
	return 1;
}

int32_t main (void) {
	int32_t i, j;
	int32_t x, y;

	scanf("%llu", &n, &m);
	scanf("%llu", &k, &m, &n);
	for (i = 0; i < n; i++) {
		scanf("%llu", &a[i]);
		// a[i]--;
	}

	solve();

	return 0;
}

Submission Info

Submission Time
Task C - ハードル走
User sheyasutaka
Language C (GCC 5.4.1)
Score 500
Code Size 2152 Byte
Status AC
Exec Time 13 ms
Memory 896 KB

Compile Error

./Main.c: In function ‘main’:
./Main.c:128:8: warning: format ‘%llu’ expects argument of type ‘long long unsigned int *’, but argument 2 has type ‘ull * {aka long unsigned int *}’ [-Wformat=]
  scanf("%llu", &n, &m);
        ^
./Main.c:128:8: warning: too many arguments for format [-Wformat-extra-args]
./Main.c:129:8: warning: format ‘%llu’ expects argument of type ‘long long unsigned int *’, but argument 2 has type ‘ull * {aka long unsigned int *}’ [-Wformat=]
  scanf("%llu", &k, &m, &n);
        ^
./Main.c:129:8: warning: too many arguments for format [-Wformat-extra-args]
./Main.c:131:9: warning: format ‘%llu’ expects argument of type ‘long long unsigned int *’, but argument 2 has type ‘ull * {aka long unsigned int *}’ [-Wformat=]
   scanf("%llu", &a[i]);
         ^
./Main.c:128:2: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
  scanf("%llu", &n, &m);
  ^
./Main.c:129:2: warning: ignoring return value of ‘scanf’, declared with attribute warn_unu...

Judge Result

Set Name Sample Small All
Score / Max Score 0 / 0 400 / 400 100 / 100
Status
AC × 7
AC × 62
AC × 109
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 1 ms 128 KB
00_sample_part_00 AC 1 ms 128 KB
00_sample_part_01 AC 1 ms 128 KB
00_sample_part_02 AC 0 ms 128 KB
00_sample_part_03 AC 0 ms 128 KB
00_sample_part_04 AC 1 ms 128 KB
00_sample_part_05 AC 1 ms 128 KB
50_random_NLsmall_part_00 AC 1 ms 128 KB
50_random_NLsmall_part_01 AC 1 ms 128 KB
50_random_NLsmall_part_02 AC 1 ms 128 KB
50_random_NLsmall_part_03 AC 0 ms 128 KB
50_random_NLsmall_part_04 AC 1 ms 128 KB
50_random_NLsmall_part_05 AC 1 ms 128 KB
50_random_NLsmall_part_06 AC 1 ms 128 KB
50_random_NLsmall_part_07 AC 1 ms 128 KB
50_random_NLsmall_part_08 AC 1 ms 128 KB
50_random_NLsmall_part_09 AC 1 ms 128 KB
50_random_XiNsmall_00 AC 1 ms 128 KB
50_random_XiNsmall_01 AC 1 ms 128 KB
50_random_XiNsmall_02 AC 1 ms 128 KB
50_random_XiNsmall_03 AC 0 ms 128 KB
50_random_XiNsmall_04 AC 0 ms 128 KB
50_random_XiNsmall_05 AC 1 ms 128 KB
50_random_XiNsmall_06 AC 1 ms 128 KB
50_random_XiNsmall_07 AC 0 ms 128 KB
50_random_XiNsmall_08 AC 1 ms 128 KB
50_random_XiNsmall_09 AC 1 ms 128 KB
50_random_XiNsmall_narrow_part_00 AC 1 ms 128 KB
50_random_XiNsmall_narrow_part_01 AC 1 ms 128 KB
50_random_XiNsmall_narrow_part_02 AC 1 ms 128 KB
50_random_XiNsmall_narrow_part_03 AC 1 ms 128 KB
50_random_XiNsmall_narrow_part_04 AC 1 ms 128 KB
50_random_XiNsmall_narrow_part_05 AC 1 ms 128 KB
50_random_XiNsmall_narrow_part_06 AC 1 ms 128 KB
50_random_XiNsmall_narrow_part_07 AC 1 ms 128 KB
50_random_XiNsmall_narrow_part_08 AC 1 ms 128 KB
50_random_XiNsmall_narrow_part_09 AC 1 ms 128 KB
50_random_XiNsmall_part_00 AC 1 ms 128 KB
50_random_XiNsmall_part_01 AC 1 ms 128 KB
50_random_XiNsmall_part_02 AC 1 ms 128 KB
50_random_XiNsmall_part_03 AC 0 ms 128 KB
50_random_XiNsmall_part_04 AC 1 ms 128 KB
50_random_XiNsmall_part_05 AC 1 ms 128 KB
50_random_XiNsmall_part_06 AC 1 ms 128 KB
50_random_XiNsmall_part_07 AC 1 ms 128 KB
50_random_XiNsmall_part_08 AC 1 ms 128 KB
50_random_XiNsmall_part_09 AC 1 ms 128 KB
50_random_Xilarge_00 AC 4 ms 384 KB
50_random_Xilarge_01 AC 2 ms 256 KB
50_random_Xilarge_02 AC 12 ms 896 KB
50_random_Xilarge_03 AC 5 ms 512 KB
50_random_Xilarge_04 AC 2 ms 256 KB
50_random_Xilarge_05 AC 12 ms 896 KB
50_random_Xilarge_06 AC 3 ms 384 KB
50_random_Xilarge_07 AC 12 ms 896 KB
50_random_Xilarge_08 AC 8 ms 640 KB
50_random_Xilarge_09 AC 7 ms 512 KB
50_random_Xilarge_narrow_00 AC 12 ms 896 KB
50_random_Xilarge_narrow_01 AC 11 ms 768 KB
50_random_Xilarge_narrow_02 AC 3 ms 384 KB
50_random_Xilarge_narrow_03 AC 4 ms 384 KB
50_random_Xilarge_narrow_04 AC 3 ms 384 KB
50_random_Xilarge_narrow_05 AC 10 ms 768 KB
50_random_Xilarge_narrow_06 AC 5 ms 512 KB
50_random_Xilarge_narrow_07 AC 3 ms 384 KB
50_random_Xilarge_narrow_08 AC 8 ms 640 KB
50_random_Xilarge_narrow_09 AC 6 ms 512 KB
50_random_x0small_00 AC 8 ms 640 KB
50_random_x0small_01 AC 4 ms 384 KB
50_random_x0small_02 AC 10 ms 768 KB
50_random_x0small_03 AC 11 ms 768 KB
50_random_x0small_04 AC 6 ms 512 KB
50_random_x0small_05 AC 12 ms 896 KB
50_random_x0small_06 AC 3 ms 256 KB
50_random_x0small_07 AC 10 ms 768 KB
50_random_x0small_08 AC 12 ms 896 KB
50_random_x0small_09 AC 8 ms 640 KB
50_random_x1small_part_00 AC 1 ms 128 KB
50_random_x1small_part_01 AC 1 ms 128 KB
50_random_x1small_part_02 AC 1 ms 128 KB
50_random_x1small_part_03 AC 1 ms 128 KB
50_random_x1small_part_04 AC 1 ms 128 KB
50_random_x1small_part_05 AC 1 ms 128 KB
50_random_x1small_part_06 AC 1 ms 128 KB
50_random_x1small_part_07 AC 1 ms 128 KB
50_random_x1small_part_08 AC 1 ms 128 KB
50_random_x1small_part_09 AC 1 ms 128 KB
80_hand_09 AC 1 ms 128 KB
80_hand_10 AC 1 ms 128 KB
80_hand_part_01 AC 1 ms 128 KB
80_hand_part_02 AC 1 ms 128 KB
80_hand_part_03 AC 1 ms 128 KB
80_hand_part_04 AC 1 ms 128 KB
80_hand_part_05 AC 1 ms 128 KB
80_hand_part_06 AC 1 ms 128 KB
80_hand_part_07 AC 1 ms 128 KB
80_hand_part_08 AC 1 ms 128 KB
80_hand_part_11 AC 1 ms 128 KB
80_hand_part_12 AC 0 ms 128 KB
90_max_no_00 AC 13 ms 896 KB
90_max_no_01 AC 13 ms 896 KB
90_max_yes_00 AC 12 ms 896 KB
90_max_yes_01 AC 12 ms 896 KB
98_challenge_part_00 AC 1 ms 128 KB
98_challenge_part_01 AC 1 ms 128 KB
98_challenge_part_02 AC 1 ms 128 KB
98_challenge_part_03 AC 0 ms 128 KB
98_challenge_part_04 AC 1 ms 128 KB
98_challenge_part_05 AC 1 ms 128 KB