답안 #689655

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
689655 2023-01-29T04:52:44 Z zeroesandones Progression (NOI20_progression) C++17
0 / 100
131 ms 6732 KB
#include "bits/stdc++.h"
using namespace std;

typedef long long ll;
typedef long double ld;
typedef vector<ll> vi;
typedef pair<ll, ll> pi;

#define FOR(i, j, k) for (ll i = j; i < (ll) k; ++i)
#define FORD(i, j, k) for (ll i = j; i >= (ll) k; --i)
#define nl "\n"
#define sp " "

#define all(x) (x).begin(), (x).end()
#define sc second
#define fr first
#define pb emplace_back

void solve()
{
    ll n, q;
    cin >> n >> q;

    ll d[n + 1];
    FOR(i, 1, n + 1) {
        cin >> d[i];
    }

    while(q--) {
        int t;
        cin >> t;

        if(t == 1) {
            ll l, r, s, c;
            cin >> l >> r >> s >> c;

            d[l] += s;
        } else if(t == 2) {
            ll l, r, s, c;
            cin >> l >> r >> s >> c;

            d[l] = s;
        } else {
            ll l, r;
            cin >> l >> r;

            // how to test the longest subarray with constant change
            cout << 1 << nl;

            /* vi diff; */
            /* FOR(i, l + 1, r + 1) { */
            /*    diff.pb(d[i] - d[i - 1]); */
            /* } */
            /* ll ans = 1, cnt = 1; */
            /* FOR(i, 1, diff.size()) { */
            /*     if(diff[i] != diff[i - 1]) { */
            /*         cnt = 1; */
            /*     } else { */
            /*         ++cnt; */
            /*     } */

            /*     ans = max(ans, cnt); */
            /* } */

            /* cout << (ans + 1) << nl; */
        }
    }
}

signed main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    ll t = 1;
    // cin >> t;
    while (t--)
    {
        solve();
    }
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 114 ms 6732 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 100 ms 3144 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 131 ms 2780 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 100 ms 3144 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 114 ms 6732 KB Output isn't correct
2 Halted 0 ms 0 KB -