結果
| 問題 |
No.865 24時間降水量
|
| コンテスト | |
| ユーザー |
square1001
|
| 提出日時 | 2019-08-17 00:45:21 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 650 bytes |
| コンパイル時間 | 862 ms |
| コンパイル使用メモリ | 74,280 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-09-23 06:34:03 |
| 合計ジャッジ時間 | 1,751 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 3 WA * 15 |
ソースコード
#include <queue>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
int main() {
cin.tie(0);
ios_base::sync_with_stdio(false);
int N, Q;
cin >> N;
vector<int> A(N);
for (int i = 0; i < N; ++i) cin >> A[i];
vector<int> sum(N - 23);
int ans = 0;
for (int i = 0; i < N - 23; ++i) {
for (int j = 0; j < 24; ++j) {
sum[i] += A[i + j];
}
ans = max(ans, sum[i]);
}
cin >> Q;
for (int i = 0; i < Q; ++i) {
int T, V;
cin >> T >> V; --T;
for (int j = T - 23; j <= T; ++j) {
if (0 <= j && j < N - 23) {
sum[j] += V - A[T];
ans = max(ans, sum[j]);
}
}
cout << ans << '\n';
}
return 0;
}
square1001