답안 #570556

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
570556 2022-05-30T12:49:34 Z duydong05 Rabbit Carrot (LMIO19_triusis) C++14
100 / 100
34 ms 8436 KB
#include <bits/stdc++.h>
#define ll long long 
#define pii pair <int , int >
#define pll pair <ll, ll >
#define FOR(i,a,b) for (int i = a; i <= b ; i++) 
#define FORD(i,a,b) for (int i =a;i >= b ; i--)
using namespace std;
const ll nMax= 2e5 +5;
const ll oo =1e9;
const ll mod =1e9 +7;
ll n, m , a[nMax] ,b[nMax],f[nMax], c[nMax];
ll sz = 0;
int lis() {
    int ret = 0;
    FOR(i,1,sz) {
        f[i] = upper_bound(c +1  , c +ret +1, b[i]) -c;
        ret= max(ret*1ll, f[i]);
        c[f[i]] = b[i];
    }
    return ret;

}
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL); cout.tie(NULL);
    cin >> n >> m ;
    FOR(i,1,n ) cin >> a[i];
    FOR(i,1,n ) {
        if (m*i - a[i] >= 0) {
            b[++sz] = m*i - a[i];
        }
    }
    cout << n - lis();

}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 340 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 340 KB Output is correct
4 Correct 1 ms 336 KB Output is correct
5 Correct 1 ms 340 KB Output is correct
6 Correct 1 ms 336 KB Output is correct
7 Correct 1 ms 212 KB Output is correct
8 Correct 1 ms 340 KB Output is correct
9 Correct 1 ms 340 KB Output is correct
10 Correct 1 ms 340 KB Output is correct
11 Correct 1 ms 324 KB Output is correct
12 Correct 1 ms 340 KB Output is correct
13 Correct 1 ms 340 KB Output is correct
14 Correct 1 ms 340 KB Output is correct
15 Correct 1 ms 336 KB Output is correct
16 Correct 1 ms 340 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 340 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 340 KB Output is correct
4 Correct 1 ms 336 KB Output is correct
5 Correct 1 ms 340 KB Output is correct
6 Correct 1 ms 336 KB Output is correct
7 Correct 1 ms 212 KB Output is correct
8 Correct 1 ms 340 KB Output is correct
9 Correct 1 ms 340 KB Output is correct
10 Correct 1 ms 340 KB Output is correct
11 Correct 1 ms 324 KB Output is correct
12 Correct 1 ms 340 KB Output is correct
13 Correct 1 ms 340 KB Output is correct
14 Correct 1 ms 340 KB Output is correct
15 Correct 1 ms 336 KB Output is correct
16 Correct 1 ms 340 KB Output is correct
17 Correct 1 ms 340 KB Output is correct
18 Correct 1 ms 332 KB Output is correct
19 Correct 1 ms 340 KB Output is correct
20 Correct 1 ms 468 KB Output is correct
21 Correct 1 ms 468 KB Output is correct
22 Correct 1 ms 340 KB Output is correct
23 Correct 1 ms 468 KB Output is correct
24 Correct 1 ms 468 KB Output is correct
25 Correct 2 ms 468 KB Output is correct
26 Correct 1 ms 468 KB Output is correct
27 Correct 1 ms 476 KB Output is correct
28 Correct 2 ms 476 KB Output is correct
29 Correct 2 ms 464 KB Output is correct
30 Correct 2 ms 468 KB Output is correct
31 Correct 1 ms 452 KB Output is correct
32 Correct 2 ms 468 KB Output is correct
33 Correct 2 ms 472 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 340 KB Output is correct
2 Correct 1 ms 332 KB Output is correct
3 Correct 1 ms 340 KB Output is correct
4 Correct 1 ms 468 KB Output is correct
5 Correct 1 ms 468 KB Output is correct
6 Correct 1 ms 340 KB Output is correct
7 Correct 1 ms 468 KB Output is correct
8 Correct 1 ms 468 KB Output is correct
9 Correct 2 ms 468 KB Output is correct
10 Correct 1 ms 468 KB Output is correct
11 Correct 1 ms 476 KB Output is correct
12 Correct 2 ms 476 KB Output is correct
13 Correct 2 ms 464 KB Output is correct
14 Correct 2 ms 468 KB Output is correct
15 Correct 1 ms 452 KB Output is correct
16 Correct 2 ms 468 KB Output is correct
17 Correct 2 ms 472 KB Output is correct
18 Correct 1 ms 340 KB Output is correct
19 Correct 1 ms 212 KB Output is correct
20 Correct 1 ms 340 KB Output is correct
21 Correct 1 ms 336 KB Output is correct
22 Correct 1 ms 340 KB Output is correct
23 Correct 1 ms 336 KB Output is correct
24 Correct 1 ms 212 KB Output is correct
25 Correct 1 ms 340 KB Output is correct
26 Correct 1 ms 340 KB Output is correct
27 Correct 1 ms 340 KB Output is correct
28 Correct 1 ms 324 KB Output is correct
29 Correct 1 ms 340 KB Output is correct
30 Correct 1 ms 340 KB Output is correct
31 Correct 1 ms 340 KB Output is correct
32 Correct 1 ms 336 KB Output is correct
33 Correct 1 ms 340 KB Output is correct
34 Correct 1 ms 344 KB Output is correct
35 Correct 1 ms 340 KB Output is correct
36 Correct 1 ms 340 KB Output is correct
37 Correct 1 ms 468 KB Output is correct
38 Correct 1 ms 472 KB Output is correct
39 Correct 1 ms 468 KB Output is correct
40 Correct 2 ms 468 KB Output is correct
41 Correct 1 ms 340 KB Output is correct
42 Correct 2 ms 472 KB Output is correct
43 Correct 2 ms 468 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 1 ms 340 KB Output is correct
3 Correct 1 ms 340 KB Output is correct
4 Correct 1 ms 468 KB Output is correct
5 Correct 1 ms 472 KB Output is correct
6 Correct 1 ms 468 KB Output is correct
7 Correct 2 ms 468 KB Output is correct
8 Correct 1 ms 340 KB Output is correct
9 Correct 2 ms 472 KB Output is correct
10 Correct 2 ms 468 KB Output is correct
11 Correct 1 ms 340 KB Output is correct
12 Correct 1 ms 332 KB Output is correct
13 Correct 1 ms 340 KB Output is correct
14 Correct 1 ms 468 KB Output is correct
15 Correct 1 ms 468 KB Output is correct
16 Correct 1 ms 340 KB Output is correct
17 Correct 1 ms 468 KB Output is correct
18 Correct 1 ms 468 KB Output is correct
19 Correct 2 ms 468 KB Output is correct
20 Correct 1 ms 468 KB Output is correct
21 Correct 1 ms 476 KB Output is correct
22 Correct 2 ms 476 KB Output is correct
23 Correct 2 ms 464 KB Output is correct
24 Correct 2 ms 468 KB Output is correct
25 Correct 1 ms 452 KB Output is correct
26 Correct 2 ms 468 KB Output is correct
27 Correct 2 ms 472 KB Output is correct
28 Correct 1 ms 340 KB Output is correct
29 Correct 1 ms 212 KB Output is correct
30 Correct 1 ms 340 KB Output is correct
31 Correct 1 ms 336 KB Output is correct
32 Correct 1 ms 340 KB Output is correct
33 Correct 1 ms 336 KB Output is correct
34 Correct 1 ms 212 KB Output is correct
35 Correct 1 ms 340 KB Output is correct
36 Correct 1 ms 340 KB Output is correct
37 Correct 1 ms 340 KB Output is correct
38 Correct 1 ms 324 KB Output is correct
39 Correct 1 ms 340 KB Output is correct
40 Correct 1 ms 340 KB Output is correct
41 Correct 1 ms 340 KB Output is correct
42 Correct 1 ms 336 KB Output is correct
43 Correct 1 ms 340 KB Output is correct
44 Correct 22 ms 6836 KB Output is correct
45 Correct 20 ms 3804 KB Output is correct
46 Correct 33 ms 5456 KB Output is correct
47 Correct 30 ms 5324 KB Output is correct
48 Correct 21 ms 7240 KB Output is correct
49 Correct 23 ms 7556 KB Output is correct
50 Correct 34 ms 6948 KB Output is correct
51 Correct 33 ms 8436 KB Output is correct
52 Correct 25 ms 6660 KB Output is correct
53 Correct 17 ms 3068 KB Output is correct
54 Correct 24 ms 7108 KB Output is correct
55 Correct 24 ms 7124 KB Output is correct