Submission #909605

# Submission time Handle Problem Language Result Execution time Memory
909605 2024-01-17T09:44:45 Z Amaarsaa Rabbit Carrot (LMIO19_triusis) C++14
100 / 100
22 ms 6104 KB
#include<bits/stdc++.h>

using namespace std;
using ll = long long ;

int main() {
//	freopen("palpath.in", "r", stdin);
//	freopen("palpath.out", "w", stdout);
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	ll t, n, m, N, bagana1, bagana2, mur1, mur2, urt, I, cost, e, k, ans, s, sum, x, y, r, p, i, j, now, last;
	
	cin >> n >> m;
	
	ll a[n + 2];
	
	for (i = 1; i <= n; i ++) {
		cin >> x;
		a[i] = x - (i * m);
		a[i] = -a[i];
	}
	a[0] = 0;
	vector < ll > v;
	for (i = 1; i <= n; i ++) {
		if ( a[i] < 0) continue;
		r = upper_bound(v.begin(), v.end(), a[i]) - v.begin();
		if ( r== v.size()) v.push_back(a[i]);
		else v[r] = a[i];
	}
	cout << n - v.size() << endl;
	
	
}

Compilation message

triusis.cpp: In function 'int main()':
triusis.cpp:27:9: warning: comparison of integer expressions of different signedness: 'll' {aka 'long long int'} and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   27 |   if ( r== v.size()) v.push_back(a[i]);
      |        ~^~~~~~~~~~~
triusis.cpp:11:5: warning: unused variable 't' [-Wunused-variable]
   11 |  ll t, n, m, N, bagana1, bagana2, mur1, mur2, urt, I, cost, e, k, ans, s, sum, x, y, r, p, i, j, now, last;
      |     ^
triusis.cpp:11:14: warning: unused variable 'N' [-Wunused-variable]
   11 |  ll t, n, m, N, bagana1, bagana2, mur1, mur2, urt, I, cost, e, k, ans, s, sum, x, y, r, p, i, j, now, last;
      |              ^
triusis.cpp:11:17: warning: unused variable 'bagana1' [-Wunused-variable]
   11 |  ll t, n, m, N, bagana1, bagana2, mur1, mur2, urt, I, cost, e, k, ans, s, sum, x, y, r, p, i, j, now, last;
      |                 ^~~~~~~
triusis.cpp:11:26: warning: unused variable 'bagana2' [-Wunused-variable]
   11 |  ll t, n, m, N, bagana1, bagana2, mur1, mur2, urt, I, cost, e, k, ans, s, sum, x, y, r, p, i, j, now, last;
      |                          ^~~~~~~
triusis.cpp:11:35: warning: unused variable 'mur1' [-Wunused-variable]
   11 |  ll t, n, m, N, bagana1, bagana2, mur1, mur2, urt, I, cost, e, k, ans, s, sum, x, y, r, p, i, j, now, last;
      |                                   ^~~~
triusis.cpp:11:41: warning: unused variable 'mur2' [-Wunused-variable]
   11 |  ll t, n, m, N, bagana1, bagana2, mur1, mur2, urt, I, cost, e, k, ans, s, sum, x, y, r, p, i, j, now, last;
      |                                         ^~~~
triusis.cpp:11:47: warning: unused variable 'urt' [-Wunused-variable]
   11 |  ll t, n, m, N, bagana1, bagana2, mur1, mur2, urt, I, cost, e, k, ans, s, sum, x, y, r, p, i, j, now, last;
      |                                               ^~~
triusis.cpp:11:52: warning: unused variable 'I' [-Wunused-variable]
   11 |  ll t, n, m, N, bagana1, bagana2, mur1, mur2, urt, I, cost, e, k, ans, s, sum, x, y, r, p, i, j, now, last;
      |                                                    ^
triusis.cpp:11:55: warning: unused variable 'cost' [-Wunused-variable]
   11 |  ll t, n, m, N, bagana1, bagana2, mur1, mur2, urt, I, cost, e, k, ans, s, sum, x, y, r, p, i, j, now, last;
      |                                                       ^~~~
triusis.cpp:11:61: warning: unused variable 'e' [-Wunused-variable]
   11 |  ll t, n, m, N, bagana1, bagana2, mur1, mur2, urt, I, cost, e, k, ans, s, sum, x, y, r, p, i, j, now, last;
      |                                                             ^
triusis.cpp:11:64: warning: unused variable 'k' [-Wunused-variable]
   11 |  ll t, n, m, N, bagana1, bagana2, mur1, mur2, urt, I, cost, e, k, ans, s, sum, x, y, r, p, i, j, now, last;
      |                                                                ^
triusis.cpp:11:67: warning: unused variable 'ans' [-Wunused-variable]
   11 |  ll t, n, m, N, bagana1, bagana2, mur1, mur2, urt, I, cost, e, k, ans, s, sum, x, y, r, p, i, j, now, last;
      |                                                                   ^~~
triusis.cpp:11:72: warning: unused variable 's' [-Wunused-variable]
   11 |  ll t, n, m, N, bagana1, bagana2, mur1, mur2, urt, I, cost, e, k, ans, s, sum, x, y, r, p, i, j, now, last;
      |                                                                        ^
triusis.cpp:11:75: warning: unused variable 'sum' [-Wunused-variable]
   11 |  ll t, n, m, N, bagana1, bagana2, mur1, mur2, urt, I, cost, e, k, ans, s, sum, x, y, r, p, i, j, now, last;
      |                                                                           ^~~
triusis.cpp:11:83: warning: unused variable 'y' [-Wunused-variable]
   11 |  ll t, n, m, N, bagana1, bagana2, mur1, mur2, urt, I, cost, e, k, ans, s, sum, x, y, r, p, i, j, now, last;
      |                                                                                   ^
triusis.cpp:11:89: warning: unused variable 'p' [-Wunused-variable]
   11 |  ll t, n, m, N, bagana1, bagana2, mur1, mur2, urt, I, cost, e, k, ans, s, sum, x, y, r, p, i, j, now, last;
      |                                                                                         ^
triusis.cpp:11:95: warning: unused variable 'j' [-Wunused-variable]
   11 |  ll t, n, m, N, bagana1, bagana2, mur1, mur2, urt, I, cost, e, k, ans, s, sum, x, y, r, p, i, j, now, last;
      |                                                                                               ^
triusis.cpp:11:98: warning: unused variable 'now' [-Wunused-variable]
   11 |  ll t, n, m, N, bagana1, bagana2, mur1, mur2, urt, I, cost, e, k, ans, s, sum, x, y, r, p, i, j, now, last;
      |                                                                                                  ^~~
triusis.cpp:11:103: warning: unused variable 'last' [-Wunused-variable]
   11 |  ll t, n, m, N, bagana1, bagana2, mur1, mur2, urt, I, cost, e, k, ans, s, sum, x, y, r, p, i, j, now, last;
      |                                                                                                       ^~~~
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 1 ms 344 KB Output is correct
3 Correct 1 ms 712 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
7 Correct 1 ms 348 KB Output is correct
8 Correct 1 ms 348 KB Output is correct
9 Correct 1 ms 344 KB Output is correct
10 Correct 1 ms 344 KB Output is correct
11 Correct 1 ms 348 KB Output is correct
12 Correct 1 ms 344 KB Output is correct
13 Correct 1 ms 344 KB Output is correct
14 Correct 1 ms 600 KB Output is correct
15 Correct 1 ms 348 KB Output is correct
16 Correct 1 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 1 ms 344 KB Output is correct
3 Correct 1 ms 712 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
7 Correct 1 ms 348 KB Output is correct
8 Correct 1 ms 348 KB Output is correct
9 Correct 1 ms 344 KB Output is correct
10 Correct 1 ms 344 KB Output is correct
11 Correct 1 ms 348 KB Output is correct
12 Correct 1 ms 344 KB Output is correct
13 Correct 1 ms 344 KB Output is correct
14 Correct 1 ms 600 KB Output is correct
15 Correct 1 ms 348 KB Output is correct
16 Correct 1 ms 348 KB Output is correct
17 Correct 0 ms 344 KB Output is correct
18 Correct 1 ms 344 KB Output is correct
19 Correct 1 ms 348 KB Output is correct
20 Correct 1 ms 348 KB Output is correct
21 Correct 1 ms 604 KB Output is correct
22 Correct 1 ms 600 KB Output is correct
23 Correct 1 ms 516 KB Output is correct
24 Correct 1 ms 604 KB Output is correct
25 Correct 1 ms 604 KB Output is correct
26 Correct 1 ms 604 KB Output is correct
27 Correct 1 ms 348 KB Output is correct
28 Correct 1 ms 604 KB Output is correct
29 Correct 1 ms 604 KB Output is correct
30 Correct 1 ms 600 KB Output is correct
31 Correct 1 ms 348 KB Output is correct
32 Correct 1 ms 344 KB Output is correct
33 Correct 1 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 1 ms 344 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 1 ms 604 KB Output is correct
6 Correct 1 ms 600 KB Output is correct
7 Correct 1 ms 516 KB Output is correct
8 Correct 1 ms 604 KB Output is correct
9 Correct 1 ms 604 KB Output is correct
10 Correct 1 ms 604 KB Output is correct
11 Correct 1 ms 348 KB Output is correct
12 Correct 1 ms 604 KB Output is correct
13 Correct 1 ms 604 KB Output is correct
14 Correct 1 ms 600 KB Output is correct
15 Correct 1 ms 348 KB Output is correct
16 Correct 1 ms 344 KB Output is correct
17 Correct 1 ms 348 KB Output is correct
18 Correct 1 ms 344 KB Output is correct
19 Correct 1 ms 344 KB Output is correct
20 Correct 1 ms 712 KB Output is correct
21 Correct 1 ms 348 KB Output is correct
22 Correct 1 ms 348 KB Output is correct
23 Correct 1 ms 348 KB Output is correct
24 Correct 1 ms 348 KB Output is correct
25 Correct 1 ms 348 KB Output is correct
26 Correct 1 ms 344 KB Output is correct
27 Correct 1 ms 344 KB Output is correct
28 Correct 1 ms 348 KB Output is correct
29 Correct 1 ms 344 KB Output is correct
30 Correct 1 ms 344 KB Output is correct
31 Correct 1 ms 600 KB Output is correct
32 Correct 1 ms 348 KB Output is correct
33 Correct 1 ms 348 KB Output is correct
34 Correct 1 ms 348 KB Output is correct
35 Correct 1 ms 544 KB Output is correct
36 Correct 2 ms 348 KB Output is correct
37 Correct 1 ms 600 KB Output is correct
38 Correct 1 ms 348 KB Output is correct
39 Correct 1 ms 600 KB Output is correct
40 Correct 1 ms 348 KB Output is correct
41 Correct 1 ms 348 KB Output is correct
42 Correct 1 ms 348 KB Output is correct
43 Correct 1 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 1 ms 544 KB Output is correct
3 Correct 2 ms 348 KB Output is correct
4 Correct 1 ms 600 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 1 ms 600 KB Output is correct
7 Correct 1 ms 348 KB Output is correct
8 Correct 1 ms 348 KB Output is correct
9 Correct 1 ms 348 KB Output is correct
10 Correct 1 ms 348 KB Output is correct
11 Correct 0 ms 344 KB Output is correct
12 Correct 1 ms 344 KB Output is correct
13 Correct 1 ms 348 KB Output is correct
14 Correct 1 ms 348 KB Output is correct
15 Correct 1 ms 604 KB Output is correct
16 Correct 1 ms 600 KB Output is correct
17 Correct 1 ms 516 KB Output is correct
18 Correct 1 ms 604 KB Output is correct
19 Correct 1 ms 604 KB Output is correct
20 Correct 1 ms 604 KB Output is correct
21 Correct 1 ms 348 KB Output is correct
22 Correct 1 ms 604 KB Output is correct
23 Correct 1 ms 604 KB Output is correct
24 Correct 1 ms 600 KB Output is correct
25 Correct 1 ms 348 KB Output is correct
26 Correct 1 ms 344 KB Output is correct
27 Correct 1 ms 348 KB Output is correct
28 Correct 1 ms 344 KB Output is correct
29 Correct 1 ms 344 KB Output is correct
30 Correct 1 ms 712 KB Output is correct
31 Correct 1 ms 348 KB Output is correct
32 Correct 1 ms 348 KB Output is correct
33 Correct 1 ms 348 KB Output is correct
34 Correct 1 ms 348 KB Output is correct
35 Correct 1 ms 348 KB Output is correct
36 Correct 1 ms 344 KB Output is correct
37 Correct 1 ms 344 KB Output is correct
38 Correct 1 ms 348 KB Output is correct
39 Correct 1 ms 344 KB Output is correct
40 Correct 1 ms 344 KB Output is correct
41 Correct 1 ms 600 KB Output is correct
42 Correct 1 ms 348 KB Output is correct
43 Correct 1 ms 348 KB Output is correct
44 Correct 13 ms 4568 KB Output is correct
45 Correct 17 ms 3924 KB Output is correct
46 Correct 21 ms 3932 KB Output is correct
47 Correct 22 ms 3928 KB Output is correct
48 Correct 17 ms 5128 KB Output is correct
49 Correct 21 ms 5296 KB Output is correct
50 Correct 21 ms 4980 KB Output is correct
51 Correct 20 ms 6104 KB Output is correct
52 Correct 21 ms 4056 KB Output is correct
53 Correct 13 ms 3160 KB Output is correct
54 Correct 17 ms 5068 KB Output is correct
55 Correct 19 ms 5076 KB Output is correct