結果
| 問題 |
No.3166 [Cherry 7th Tune *] 桜の守人
|
| コンテスト | |
| ユーザー |
テナガザル
|
| 提出日時 | 2025-05-30 21:46:37 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 13 ms / 2,000 ms |
| コード長 | 475 bytes |
| コンパイル時間 | 1,094 ms |
| コンパイル使用メモリ | 107,364 KB |
| 実行使用メモリ | 7,844 KB |
| 最終ジャッジ日時 | 2025-05-30 21:46:39 |
| 合計ジャッジ時間 | 2,099 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 26 |
ソースコード
#include <iostream>
#include <vector>
#include <algorithm>
#include <set>
using namespace std;
int main()
{
int t;
cin >> t;
while (t--)
{
int n, l, k;
cin >> n >> l >> k;
vector<int> a(2 * n);
for (int i = 0; i < n; ++i) cin >> a[i];
for (int i = 0; i < n; ++i) a[i + n] = a[i] + l;
sort(a.begin(), a.end());
int ma = 0;
for (int i = 0; i < n; ++i) ma = max(a[i + k] - a[i], ma);
ma = (ma + 1) / 2;
cout << ma << endl;
}
}
テナガザル