結果
問題 | No.865 24時間降水量 |
ユーザー | risujiroh |
提出日時 | 2019-08-16 21:31:33 |
言語 | C++14 (gcc 12.3.0 + boost 1.83.0) |
結果 |
AC
|
実行時間 | 92 ms / 2,000 ms |
コード長 | 659 bytes |
コンパイル時間 | 1,962 ms |
コンパイル使用メモリ | 169,448 KB |
実行使用メモリ | 4,348 KB |
最終ジャッジ日時 | 2023-10-23 21:40:30 |
合計ジャッジ時間 | 3,750 ms |
ジャッジサーバーID (参考情報) |
judge13 / judge11 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 2 ms
4,348 KB |
testcase_01 | AC | 2 ms
4,348 KB |
testcase_02 | AC | 2 ms
4,348 KB |
testcase_03 | AC | 2 ms
4,348 KB |
testcase_04 | AC | 2 ms
4,348 KB |
testcase_05 | AC | 2 ms
4,348 KB |
testcase_06 | AC | 2 ms
4,348 KB |
testcase_07 | AC | 2 ms
4,348 KB |
testcase_08 | AC | 2 ms
4,348 KB |
testcase_09 | AC | 2 ms
4,348 KB |
testcase_10 | AC | 5 ms
4,348 KB |
testcase_11 | AC | 5 ms
4,348 KB |
testcase_12 | AC | 5 ms
4,348 KB |
testcase_13 | AC | 5 ms
4,348 KB |
testcase_14 | AC | 5 ms
4,348 KB |
testcase_15 | AC | 92 ms
4,348 KB |
testcase_16 | AC | 92 ms
4,348 KB |
testcase_17 | AC | 92 ms
4,348 KB |
testcase_18 | AC | 2 ms
4,348 KB |
testcase_19 | AC | 2 ms
4,348 KB |
testcase_20 | AC | 2 ms
4,348 KB |
ソースコード
#include <bits/stdc++.h> using namespace std; using lint = long long; template<class T = int> using V = vector<T>; template<class T = int> using VV = V< V<T> >; int main() { cin.tie(nullptr); ios::sync_with_stdio(false); int n; cin >> n; V<> a(n); for (auto&& e : a) cin >> e; int q; cin >> q; int res = 0; for (int i = 0; i + 24 <= n; ++i) { res = max(res, accumulate(begin(a) + i, begin(a) + i + 24, 0)); } while (q--) { int t, x; cin >> t >> x, --t; a[t] = x; for (int i = max(t - 23, 0); i <= min(t, n - 24); ++i) { res = max(res, accumulate(begin(a) + i, begin(a) + i + 24, 0)); } cout << res << '\n'; } }