結果
| 問題 | No.3715 Tomorrow is MONDAY!!!!!! |
| コンテスト | |
| ユーザー |
ぽえ
|
| 提出日時 | 2026-09-18 19:12:27 |
| 言語 | C++23 (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 61 ms / 2,000 ms |
| + 821µs | |
| コード長 | 564 bytes |
| 記録 | |
| コンパイル時間 | 2,095 ms |
| コンパイル使用メモリ | 332,744 KB |
| 実行使用メモリ | 6,528 KB |
| 最終ジャッジ日時 | 2026-09-18 20:52:06 |
| 合計ジャッジ時間 | 5,961 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 27 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
int k; ll n; cin >> k >> n;
vector<ll> d(k);
ll s = 0;
for (auto& i : d) { cin >> i; s += i; }
ll l=0, r=0;
for (int i=0; i<k; i++, l=r) {
ll ans = numeric_limits<ll>::max();
ll x = l%n;
if (x == 0) x = n;
if (x <= l-i) ans = min(ans, x);
r = l+d[i];
ll y = n-(r-1)%n;
if (y <= s-r-(k-i-1)) ans = min(ans, y);
cout << (ans==numeric_limits<ll>::max() ? -1 : ans) << '\n';
}
}
ぽえ