結果
問題 | No.2559 眩しい数直線 |
ユーザー |
|
提出日時 | 2023-12-02 14:45:57 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 2,000 ms |
コード長 | 705 bytes |
コンパイル時間 | 2,693 ms |
コンパイル使用メモリ | 175,696 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-09-26 17:19:25 |
合計ジャッジ時間 | 3,123 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 20 |
ソースコード
//#define _GLIBCXX_DEBUG#include <bits/stdc++.h>#include <atcoder/modint>#include <atcoder/dsu>#include <boost/rational.hpp>using namespace std;using namespace atcoder;using ll = long long;using mint = modint998244353;const double pi = 3.14159265359879323846264338327950288419;const ll INF = 9 * 1e18;using p = pair<ll, ll>;int main() {int n, x; cin >> n >> x;vector<int> ans(x);for(int i = 0; i < n; i++){int a, b; cin >> a >> b;a--;for(int j = a - b; j < a+b; j++){if(j < 0 or j >= x) continue;//cerr << j << " " << b - abs(j - a) << endl;ans[j] = max(ans[j], b - abs(j - a));}}for(auto v : ans) cout << v << " ";cout << endl;}