Submission #125630

# Submission time Handle Problem Language Result Execution time Memory
125630 2019-07-06T06:01:52 Z 윤교준(#3070) None (JOI16_ho_t5) C++14
34 / 100
2000 ms 5624 KB
#include <bits/stdc++.h>
#define eb emplace_back
#define sz(V) ((int)(V).size())
#define upmin(a,b) (a)=min((a),(b))
#define INFLL (0x3f3f3f3f3f3f3f3fll)
using namespace std;
typedef long long ll;
typedef pair<ll, int> pli;

const int MAXN = 200055;
const int MAXQ = 200055;

ll A[MAXQ], B[MAXQ];
bitset<MAXQ> C;

int N, Q;

int main() {
	ios::sync_with_stdio(false);

	cin >> N >> Q;
	for(int i = 1; i <= Q; i++) {
		int c; cin >> A[i] >> c >> B[i];
		C[i] = 2 == c;
	}

	for(int i = 0; i < N; i++) {
		ll x = i, y = -i;
		for(int qi = Q; qi; qi--) {
			if(!C[qi]) {
				if(y > -A[qi]) x -= B[qi]<<1;
			} else {
				if(x >= A[qi]) y -= B[qi]<<1;
			}
		}
		printf("%lld\n", (-x-y) >> 1);
	}

	return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 2 ms 376 KB Output is correct
4 Correct 2 ms 376 KB Output is correct
5 Correct 2 ms 376 KB Output is correct
6 Correct 2 ms 376 KB Output is correct
7 Correct 2 ms 376 KB Output is correct
8 Correct 2 ms 376 KB Output is correct
9 Correct 2 ms 296 KB Output is correct
10 Correct 2 ms 376 KB Output is correct
11 Correct 2 ms 376 KB Output is correct
12 Correct 2 ms 376 KB Output is correct
13 Correct 2 ms 376 KB Output is correct
14 Correct 2 ms 376 KB Output is correct
15 Correct 2 ms 376 KB Output is correct
16 Correct 2 ms 376 KB Output is correct
17 Correct 2 ms 380 KB Output is correct
18 Correct 2 ms 384 KB Output is correct
19 Correct 2 ms 376 KB Output is correct
20 Correct 2 ms 376 KB Output is correct
21 Correct 2 ms 376 KB Output is correct
22 Correct 2 ms 376 KB Output is correct
23 Correct 2 ms 376 KB Output is correct
24 Correct 2 ms 380 KB Output is correct
25 Correct 2 ms 376 KB Output is correct
26 Correct 2 ms 376 KB Output is correct
27 Correct 2 ms 376 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 2 ms 376 KB Output is correct
4 Correct 2 ms 376 KB Output is correct
5 Correct 2 ms 376 KB Output is correct
6 Correct 2 ms 376 KB Output is correct
7 Correct 2 ms 376 KB Output is correct
8 Correct 2 ms 376 KB Output is correct
9 Correct 2 ms 296 KB Output is correct
10 Correct 2 ms 376 KB Output is correct
11 Correct 2 ms 376 KB Output is correct
12 Correct 2 ms 376 KB Output is correct
13 Correct 2 ms 376 KB Output is correct
14 Correct 2 ms 376 KB Output is correct
15 Correct 2 ms 376 KB Output is correct
16 Correct 2 ms 376 KB Output is correct
17 Correct 2 ms 380 KB Output is correct
18 Correct 2 ms 384 KB Output is correct
19 Correct 2 ms 376 KB Output is correct
20 Correct 2 ms 376 KB Output is correct
21 Correct 2 ms 376 KB Output is correct
22 Correct 2 ms 376 KB Output is correct
23 Correct 2 ms 376 KB Output is correct
24 Correct 2 ms 380 KB Output is correct
25 Correct 2 ms 376 KB Output is correct
26 Correct 2 ms 376 KB Output is correct
27 Correct 2 ms 376 KB Output is correct
28 Correct 45 ms 504 KB Output is correct
29 Correct 45 ms 504 KB Output is correct
30 Correct 46 ms 380 KB Output is correct
31 Correct 48 ms 504 KB Output is correct
32 Correct 45 ms 376 KB Output is correct
33 Correct 45 ms 480 KB Output is correct
34 Correct 53 ms 380 KB Output is correct
35 Correct 46 ms 376 KB Output is correct
36 Correct 37 ms 504 KB Output is correct
37 Correct 43 ms 492 KB Output is correct
38 Correct 52 ms 504 KB Output is correct
39 Correct 45 ms 504 KB Output is correct
40 Correct 49 ms 504 KB Output is correct
41 Correct 51 ms 504 KB Output is correct
42 Correct 49 ms 504 KB Output is correct
43 Correct 35 ms 504 KB Output is correct
44 Correct 42 ms 632 KB Output is correct
45 Correct 41 ms 504 KB Output is correct
46 Correct 46 ms 504 KB Output is correct
47 Correct 47 ms 488 KB Output is correct
48 Correct 20 ms 504 KB Output is correct
49 Correct 20 ms 504 KB Output is correct
50 Correct 20 ms 504 KB Output is correct
51 Correct 20 ms 504 KB Output is correct
52 Correct 19 ms 504 KB Output is correct
53 Correct 20 ms 376 KB Output is correct
54 Correct 20 ms 504 KB Output is correct
55 Correct 20 ms 376 KB Output is correct
56 Correct 19 ms 504 KB Output is correct
57 Correct 21 ms 376 KB Output is correct
58 Correct 20 ms 504 KB Output is correct
59 Correct 20 ms 376 KB Output is correct
60 Correct 21 ms 504 KB Output is correct
61 Correct 20 ms 376 KB Output is correct
62 Correct 31 ms 504 KB Output is correct
63 Correct 32 ms 516 KB Output is correct
64 Correct 37 ms 504 KB Output is correct
65 Correct 37 ms 376 KB Output is correct
66 Correct 38 ms 504 KB Output is correct
67 Correct 38 ms 504 KB Output is correct
68 Correct 39 ms 504 KB Output is correct
69 Correct 39 ms 376 KB Output is correct
70 Correct 2 ms 376 KB Output is correct
71 Correct 2 ms 376 KB Output is correct
72 Correct 2 ms 376 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 2 ms 376 KB Output is correct
4 Correct 2 ms 376 KB Output is correct
5 Correct 2 ms 376 KB Output is correct
6 Correct 2 ms 376 KB Output is correct
7 Correct 2 ms 376 KB Output is correct
8 Correct 2 ms 376 KB Output is correct
9 Correct 2 ms 296 KB Output is correct
10 Correct 2 ms 376 KB Output is correct
11 Correct 2 ms 376 KB Output is correct
12 Correct 2 ms 376 KB Output is correct
13 Correct 2 ms 376 KB Output is correct
14 Correct 2 ms 376 KB Output is correct
15 Correct 2 ms 376 KB Output is correct
16 Correct 2 ms 376 KB Output is correct
17 Correct 2 ms 380 KB Output is correct
18 Correct 2 ms 384 KB Output is correct
19 Correct 2 ms 376 KB Output is correct
20 Correct 2 ms 376 KB Output is correct
21 Correct 2 ms 376 KB Output is correct
22 Correct 2 ms 376 KB Output is correct
23 Correct 2 ms 376 KB Output is correct
24 Correct 2 ms 380 KB Output is correct
25 Correct 2 ms 376 KB Output is correct
26 Correct 2 ms 376 KB Output is correct
27 Correct 2 ms 376 KB Output is correct
28 Correct 45 ms 504 KB Output is correct
29 Correct 45 ms 504 KB Output is correct
30 Correct 46 ms 380 KB Output is correct
31 Correct 48 ms 504 KB Output is correct
32 Correct 45 ms 376 KB Output is correct
33 Correct 45 ms 480 KB Output is correct
34 Correct 53 ms 380 KB Output is correct
35 Correct 46 ms 376 KB Output is correct
36 Correct 37 ms 504 KB Output is correct
37 Correct 43 ms 492 KB Output is correct
38 Correct 52 ms 504 KB Output is correct
39 Correct 45 ms 504 KB Output is correct
40 Correct 49 ms 504 KB Output is correct
41 Correct 51 ms 504 KB Output is correct
42 Correct 49 ms 504 KB Output is correct
43 Correct 35 ms 504 KB Output is correct
44 Correct 42 ms 632 KB Output is correct
45 Correct 41 ms 504 KB Output is correct
46 Correct 46 ms 504 KB Output is correct
47 Correct 47 ms 488 KB Output is correct
48 Correct 20 ms 504 KB Output is correct
49 Correct 20 ms 504 KB Output is correct
50 Correct 20 ms 504 KB Output is correct
51 Correct 20 ms 504 KB Output is correct
52 Correct 19 ms 504 KB Output is correct
53 Correct 20 ms 376 KB Output is correct
54 Correct 20 ms 504 KB Output is correct
55 Correct 20 ms 376 KB Output is correct
56 Correct 19 ms 504 KB Output is correct
57 Correct 21 ms 376 KB Output is correct
58 Correct 20 ms 504 KB Output is correct
59 Correct 20 ms 376 KB Output is correct
60 Correct 21 ms 504 KB Output is correct
61 Correct 20 ms 376 KB Output is correct
62 Correct 31 ms 504 KB Output is correct
63 Correct 32 ms 516 KB Output is correct
64 Correct 37 ms 504 KB Output is correct
65 Correct 37 ms 376 KB Output is correct
66 Correct 38 ms 504 KB Output is correct
67 Correct 38 ms 504 KB Output is correct
68 Correct 39 ms 504 KB Output is correct
69 Correct 39 ms 376 KB Output is correct
70 Correct 2 ms 376 KB Output is correct
71 Correct 2 ms 376 KB Output is correct
72 Correct 2 ms 376 KB Output is correct
73 Execution timed out 2060 ms 5624 KB Time limit exceeded
74 Halted 0 ms 0 KB -