結果
問題 | No.2559 眩しい数直線 |
ユーザー | through |
提出日時 | 2023-12-07 19:07:46 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 4 ms / 2,000 ms |
コード長 | 596 bytes |
コンパイル時間 | 1,753 ms |
コンパイル使用メモリ | 168,920 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-09-27 02:17:32 |
合計ジャッジ時間 | 2,509 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 20 |
ソースコード
#include <bits/stdc++.h> using namespace std; using ll = long long; using P = pair<ll, ll>; using T = tuple<ll, ll, ll>; // #include <atcoder/all> // using namespace atcoder; // using mint = modint1000000007; #define rep(i, n) for(ll i = 0; i < n; i++) int main() { cin.tie(nullptr); ios_base::sync_with_stdio(false); ll n, x; cin >> n >> x; vector<ll> a(n), b(n), ans(x,0); rep(i,n) { cin >> a[i] >> b[i]; a[i]--; rep(j,x) ans[j] = max(ans[j], max(b[i]-abs(j-a[i]),0ll)); } rep(i,x) cout << ans[i] << " "; cout << endl; return 0; }