Time Exceeded
Code
/*
* Copyright (c) 2025 Emon Thakur
* All rights reserved.
*/
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
ll a[100005];
int main()
{
int t; cin >> t; while(t--)
{
ll n; cin >> n;
for(int i=1;i<=n;i++) cin >> a[i];
int q; cin >> q;
while(q--)
{
ll type,l,r,x; cin >> type;
if(type==1)
{
cin >> l >> r >> x;
for(int i=l;i<=r;i++) a[i]+=x;
}
else
{
ll mx = -1e18;
cin >> l >> r;
for(int i=l;i<=r;i++) mx = max(mx,a[i]);
cout<<mx<<'\n';
}
}
}
}
Information
- Submit By
- Type
- Submission
- Problem
- P1211 Range MAX
- Language
- C++17 (G++ 13.2.0)
- Submit At
- 2025-07-10 09:11:19
- Judged At
- 2025-07-10 09:11:19
- Judged By
- Score
- 82
- Total Time
- ≥5097ms
- Peak Memory
- ≥1.805 MiB