結果
| 問題 | No.3684 chokudai_niku.png |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-09-09 21:01:31 |
| 言語 | C++23(gcc16) (gcc 16.1.0 + boost 1.92.0 + ACL) |
| 結果 |
TLE
不安定
|
| 実行時間 | - |
| コード長 | 728 bytes |
| 記録 | |
| コンパイル時間 | 3,532 ms |
| コンパイル使用メモリ | 352,720 KB |
| 実行使用メモリ | 6,528 KB |
| 最終ジャッジ日時 | 2026-09-09 21:01:41 |
| 合計ジャッジ時間 | 9,261 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge3_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | TLE * 1 -- * 43 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define vl vector<ll>
#define vvl vector<vl>
template<class T> inline int chmax(T &a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline int chmin(T &a, T b) { if (a > b) { a = b; return 1; } return 0; }
auto _ = []() { ios::sync_with_stdio(false); cin.tie(nullptr); return 0; }();
int main() {
ll N, M; cin >> N >> M;
vl A(N), B(N);
for (auto& x : A) cin >> x; for (auto& x : B) cin >> x;
ll ma = 0;
for (int s = 0; s <= N - M; s++) {
ll cur = 0;
for (int i = 0; i < M; i++) cur += max(0LL, A[s + i] - B[s + i]);
chmax(ma, cur);
}
cout << ma << "\n";
return 0;
}