結果

問題 No.865 24時間降水量
ユーザー betrue12betrue12
提出日時 2019-08-16 21:37:56
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 483 bytes
コンパイル時間 1,683 ms
コンパイル使用メモリ 169,248 KB
実行使用メモリ 9,416 KB
最終ジャッジ日時 2023-10-23 21:55:46
合計ジャッジ時間 5,871 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
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 4 ms
4,348 KB
testcase_06 AC 4 ms
4,348 KB
testcase_07 AC 5 ms
4,348 KB
testcase_08 AC 4 ms
4,348 KB
testcase_09 AC 5 ms
4,348 KB
testcase_10 AC 28 ms
4,348 KB
testcase_11 AC 28 ms
4,348 KB
testcase_12 AC 28 ms
4,348 KB
testcase_13 AC 28 ms
4,348 KB
testcase_14 AC 28 ms
4,348 KB
testcase_15 TLE -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main(){
    int N;
    cin >> N;
    vector<int> A(N);
    for(int i=0; i<N; i++) cin >> A[i];
    vector<int> S(N+24);
    for(int i=0; i<N; i++) for(int j=0; j<24; j++) S[i+j] += A[i];
    int Q;
    cin >> Q;
    while(Q--){
        int t, v;
        cin >> t >> v;
        t--;
        for(int j=0; j<24; j++) S[t+j] += v - A[t];
        A[t] = v;
        cout << *max_element(S.begin(), S.end()) << endl;
    }
    return 0;
}
0