Submission #689655

#TimeUsernameProblemLanguageResultExecution timeMemory
689655zeroesandonesProgression (NOI20_progression)C++17
0 / 100
131 ms6732 KiB
#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(); } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...