結果
| 問題 | No.865 24時間降水量 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-08-25 20:39:22 |
| 言語 | C++23(gcc16) (gcc 16.1.0 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 57 ms / 2,000 ms |
| + 907µs | |
| コード長 | 907 bytes |
| 記録 | |
| コンパイル時間 | 3,299 ms |
| コンパイル使用メモリ | 351,336 KB |
| 実行使用メモリ | 6,272 KB |
| 最終ジャッジ日時 | 2026-08-25 20:39:41 |
| 合計ジャッジ時間 | 5,489 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 18 |
ソースコード
// <DATETIME>
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pii pair<int, int>
#define fi first
#define se second
#define rep(i, x, y) for (int i = (x); i <= (y); i ++ )
#define per(i, x, y) for (int i = (x); i >= (y); i -- )
const int N = 5e5 + 5, M = 1e6 + 5;
const int inf = 1e9, mod = 998244353;
const ll INF = 1e18, RMX = 2324814;
mt19937 rd(time(0));
uniform_int_distribution<int> dist(0, RMX);
int n, a[N], q;
signed main(){
ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
cin >> n;
rep(i, 1, n) cin >> a[i];
ll mx = 0;
rep(i, 24, n){
ll sum = 0;
rep(j, i - 23, i) sum += a[j];
mx = max(mx, sum);
}
cin >> q;
while (q -- ){
int pos, x; cin >> pos >> x;
a[pos] = x;
rep(i, max(pos, 24), min(pos + 23, n)){
ll sum = 0;
rep(j, i - 23, i) sum += a[j];
mx = max(mx, sum);
}
cout << mx << "\n";
}
}