結果

問題 No.2559 眩しい数直線
ユーザー GOTKAKO
提出日時 2023-12-02 14:33:54
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 3 ms / 2,000 ms
コード長 470 bytes
コンパイル時間 1,929 ms
コンパイル使用メモリ 194,684 KB
最終ジャッジ日時 2025-02-18 03:35:33
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

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

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    int N,X; cin >> N >> X;
    vector<int> answer(X);
    for(int i=0; i<N; i++){
        int a,b; cin >> a >> b;
        a--;
        for(int k=0; k<X; k++){
            answer.at(k) = max(answer.at(k),max(b-abs(k-a),0));
        }
    }
    for(int i=0; i<X; i++){
        if(i) cout << " ";
        cout << answer.at(i);
    }
    cout << endl;
}
0