結果
問題 | No.2559 眩しい数直線 |
ユーザー |
![]() |
提出日時 | 2023-12-02 14:50:48 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 2,000 ms |
コード長 | 518 bytes |
コンパイル時間 | 1,802 ms |
コンパイル使用メモリ | 194,488 KB |
最終ジャッジ日時 | 2025-02-18 03:59:26 |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 20 |
ソースコード
#include<bits/stdc++.h> using namespace std; #define rep(i,n) for (int i = 0; i < (n); ++i) using ll = long long; int ctoi(char c){return c-'0';} ll ctoll(char c){return c-'0';} int main(){ int n,x; cin >> n >> x; vector<pair<int,int> >ab(n); rep(i,n)cin >> ab[i].first >> ab[i].second; rep(i,x){ int ans = 0; rep(j,n){ ans = max(ans,max(ab[j].second - abs((i+1)-ab[j].first), 0)); } cout << ans << " "; } cout << endl; }