結果
| 問題 | No.2890 Chiffon |
| コンテスト | |
| ユーザー |
👑 Nachia
|
| 提出日時 | 2024-09-13 22:02:14 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,020 bytes |
| 記録 | |
| コンパイル時間 | 488 ms |
| コンパイル使用メモリ | 99,868 KB |
| 実行使用メモリ | 45,304 KB |
| 最終ジャッジ日時 | 2026-07-05 16:43:25 |
| 合計ジャッジ時間 | 6,227 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 46 WA * 3 RE * 4 |
ソースコード
#ifdef NACHIA
#define _GLIBCXX_DEBUG
#else
#define NDEBUG
#endif
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using i64 = long long;
using u64 = unsigned long long;
#define rep(i,n) for(int i=0; i<int(n); i++)
const i64 INF = 1001001001001001001;
template<typename A> void chmin(A& l, const A& r){ if(r < l) l = r; }
template<typename A> void chmax(A& l, const A& r){ if(l < r) l = r; }
#include <atcoder/modint>
using Modint = atcoder::static_modint<998244353>;
using namespace std;
void testcase(){
i64 N, K; cin >> N >> K;
vector<i64> A(K);
rep(i,K) cin >> A[i];
rep(i,K+1) A.push_back(A[i] + N*2);
for(i64 k=N/K*2; k>=2; k-=2){
vector<i64> lf = A;
rep(i,K*2-1) chmax(lf[i+1], lf[i] + k);
i64 ok = true;
for(i64 i=K; i<2*K; i++) if(lf[i-1] + k + 1 > A[i+1] - 1) ok = false;
if(ok){ cout << k << endl; return; }
}
}
int main(){
ios::sync_with_stdio(false); cin.tie(nullptr);
rep(t,3) testcase();
return 0;
}
Nachia