Submission #832641

# Submission time Handle Problem Language Result Execution time Memory
832641 2023-08-21T12:52:43 Z _martynas Progression (NOI20_progression) C++11
15 / 100
3000 ms 12428 KB
#include <iostream>

using namespace std;

using ll = long long;

const int mxn = 3e5+5;

int n, q;
ll D[mxn];

int main() {
    cin >> n >> q;
    for(int i = 1; i <= n; i++) cin >> D[i];
    for(int i = 0; i < q; i++) {
        ll t, l, r, s, c; cin >> t >> l >> r;
        if(t == 1) {
            cin >> s >> c;
            for(int j = l; j <= r; j++) D[j] += s+(j-l)*c;
        }
        else if(t == 2) {
            cin >> s >> c;
            for(int j = l; j <= r; j++) D[j] = s+(j-l)*c;
        }
        else {
            int ans = 1, diff = D[l+1]-D[l], cnt = 1;
            for(int j = l+1; j <= r; j++) {
                if(diff == D[j]-D[j-1]) {
                    cnt++; ans = max(ans, cnt);
                }
                else {
                    diff = D[j]-D[j-1], cnt = 2;
                }
            }
            cout << ans << "\n";
        }
    }
    return 0;
}
# Verdict Execution time Memory Grader output
1 Execution timed out 3031 ms 5208 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 340 KB Output is correct
2 Correct 2 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 2 ms 212 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 2 ms 324 KB Output is correct
7 Correct 1 ms 212 KB Output is correct
8 Correct 2 ms 324 KB Output is correct
9 Correct 2 ms 212 KB Output is correct
10 Correct 2 ms 212 KB Output is correct
11 Correct 3 ms 212 KB Output is correct
12 Correct 3 ms 340 KB Output is correct
13 Correct 2 ms 324 KB Output is correct
14 Correct 2 ms 212 KB Output is correct
15 Correct 3 ms 340 KB Output is correct
16 Correct 2 ms 340 KB Output is correct
17 Correct 2 ms 340 KB Output is correct
18 Correct 2 ms 340 KB Output is correct
19 Correct 1 ms 212 KB Output is correct
20 Correct 1 ms 320 KB Output is correct
21 Correct 1 ms 212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 589 ms 9700 KB Output is correct
2 Correct 418 ms 2968 KB Output is correct
3 Correct 432 ms 2864 KB Output is correct
4 Correct 450 ms 2860 KB Output is correct
5 Correct 431 ms 3124 KB Output is correct
6 Correct 433 ms 3188 KB Output is correct
7 Correct 446 ms 3108 KB Output is correct
8 Correct 3 ms 216 KB Output is correct
9 Correct 3 ms 212 KB Output is correct
10 Correct 2 ms 312 KB Output is correct
11 Execution timed out 3064 ms 3808 KB Time limit exceeded
12 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 582 ms 12428 KB Output is correct
2 Correct 273 ms 3628 KB Output is correct
3 Correct 265 ms 3652 KB Output is correct
4 Correct 295 ms 3632 KB Output is correct
5 Correct 339 ms 3620 KB Output is correct
6 Correct 260 ms 3668 KB Output is correct
7 Correct 264 ms 3628 KB Output is correct
8 Correct 1 ms 212 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
10 Correct 2 ms 212 KB Output is correct
11 Execution timed out 3086 ms 4720 KB Time limit exceeded
12 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 589 ms 9700 KB Output is correct
2 Correct 418 ms 2968 KB Output is correct
3 Correct 432 ms 2864 KB Output is correct
4 Correct 450 ms 2860 KB Output is correct
5 Correct 431 ms 3124 KB Output is correct
6 Correct 433 ms 3188 KB Output is correct
7 Correct 446 ms 3108 KB Output is correct
8 Correct 3 ms 216 KB Output is correct
9 Correct 3 ms 212 KB Output is correct
10 Correct 2 ms 312 KB Output is correct
11 Execution timed out 3064 ms 3808 KB Time limit exceeded
12 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 3031 ms 5208 KB Time limit exceeded
2 Halted 0 ms 0 KB -