結果
| 問題 | No.2559 眩しい数直線 | 
| コンテスト | |
| ユーザー |  umezo | 
| 提出日時 | 2023-12-02 14:37:07 | 
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 4 ms / 2,000 ms | 
| コード長 | 468 bytes | 
| コンパイル時間 | 2,083 ms | 
| コンパイル使用メモリ | 195,052 KB | 
| 最終ジャッジ日時 | 2025-02-18 03:40:25 | 
| ジャッジサーバーID (参考情報) | judge3 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 20 | 
ソースコード
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define ALL(v) v.begin(),v.end()
typedef long long ll;
 
#include<bits/stdc++.h>
using namespace std;
 
int main(){
  ios::sync_with_stdio(false);
  std::cin.tie(nullptr);
  
  int n,x;
  cin>>n>>x;
  vector<int> C(x+1);
  rep(i,n){
    int a,b;
    cin>>a>>b;
    for(int j=1;j<=x;j++) C[j]=max(C[j],max(0,b-abs(j-a)));
  }
  for(int i=1;i<=x;i++){
    if(i) cout<<" ";
    cout<<C[i];
  }
  cout<<endl;
    
  return 0;
}
            
            
            
        