結果

問題 No.2559 眩しい数直線
ユーザー Jikky1618
提出日時 2025-09-03 07:37:51
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 3 ms / 2,000 ms
コード長 595 bytes
コンパイル時間 3,162 ms
コンパイル使用メモリ 276,992 KB
実行使用メモリ 7,716 KB
最終ジャッジ日時 2025-09-03 07:37:56
合計ジャッジ時間 4,221 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll = long long;

#ifdef LOCAL
#include <debug.hpp>
#else
#define debug(...)
#endif

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(20);
    int N, X;
    cin >> N >> X;
    vector<int> A(N), B(N);
    for (int i = 0; i < N; i++) cin >> A[i] >> B[i], A[i]--;
    vector<int> L(X);
    for (int i = 0; i < X; i++) {
        for (int j = 0; j < N; j++) {
            L[i] = max(L[i], B[j] - abs(i - A[j]));
        }
    }
    for (int i = 0; i < X; i++) cout << L[i] << " \n"[i + 1 == X];
}
0