結果
問題 | No.2559 眩しい数直線 |
ユーザー | SyimP |
提出日時 | 2023-12-02 14:59:54 |
言語 | C++14 (gcc 12.3.0 + boost 1.83.0) |
結果 |
AC
|
実行時間 | 3 ms / 2,000 ms |
コード長 | 4,502 bytes |
コンパイル時間 | 1,839 ms |
コンパイル使用メモリ | 172,652 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-09-26 17:51:52 |
合計ジャッジ時間 | 2,476 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 2 ms
5,248 KB |
testcase_01 | AC | 1 ms
5,248 KB |
testcase_02 | AC | 2 ms
5,376 KB |
testcase_03 | AC | 2 ms
5,376 KB |
testcase_04 | AC | 2 ms
5,376 KB |
testcase_05 | AC | 2 ms
5,376 KB |
testcase_06 | AC | 3 ms
5,376 KB |
testcase_07 | AC | 3 ms
5,376 KB |
testcase_08 | AC | 2 ms
5,376 KB |
testcase_09 | AC | 2 ms
5,376 KB |
testcase_10 | AC | 2 ms
5,376 KB |
testcase_11 | AC | 1 ms
5,376 KB |
testcase_12 | AC | 2 ms
5,376 KB |
testcase_13 | AC | 3 ms
5,376 KB |
testcase_14 | AC | 3 ms
5,376 KB |
testcase_15 | AC | 3 ms
5,376 KB |
testcase_16 | AC | 2 ms
5,376 KB |
testcase_17 | AC | 2 ms
5,376 KB |
testcase_18 | AC | 1 ms
5,376 KB |
testcase_19 | AC | 2 ms
5,376 KB |
testcase_20 | AC | 3 ms
5,376 KB |
testcase_21 | AC | 2 ms
5,376 KB |
testcase_22 | AC | 3 ms
5,376 KB |
ソースコード
#include <bits/stdc++.h> #include <iomanip> #define rep(i,n) for (int i = (int)(0); i < (int)(n); i++) #define rep1(i,n) for (int i = (int)(1); i <= (int)(n); i++) #define REP(i,s,n) for (int i = (int)(s); i < (int)(n); i++) #define mrep(i,s,n) for (int i = (int)(s) - 1; i >= (int)(n); i--) #define fore(i,a) for(auto &i:a) #define all(c) begin(c), end(c) #define rall(x) x.rbegin(), x.rend() #define vcsort(x) sort(all(x)) #define rev(x) reverse(all(x)) #define vcerase(x) x.erase(unique(all(x)),x.end()) #define vcsum(x) accumulate(all(x),0) #define vcmax(x) *max_element(all(x)) #define vcmin(x) *min_element(all(x)) #define FI first #define SE second #define pb(x) push_back(x) #define ppb(x) pop_back(X) #define EL '\n' #define v(type, name, ...) vector<type> name(__VA_ARGS__) #define vv(type, name, h, ...) vector<vector<type>> name(h, vector<type>(__VA_ARGS__)) #define vvv(type, name, h, w, ...) vector<vector<vector<type>>> name(h, vector<vector<type>>(w, vector<type>(__VA_ARGS__))) //#define print(x) cout << x << "\n"; //----- using namespace std; using ll = long long; using Ul = unsigned long long; using cl = const ll; using VI = vector<int>; using VS = vector<string>; using VC = vector<char>; using VL = vector<ll>; using VB = vector<bool>; using PI = pair<int, int>; using PL = pair<ll, ll>; using SI = set<int>; using MII = map<int, int>; using MIS = map<int, string>; using MSI = map<string, int>; template<class t> using V = vector<t>; template< typename T > //vector<int> a(n); cin >> a; ostream &operator<<(ostream &os, const vector< T > &v) { for(int i = 0; i < (int) v.size(); i++) { os << v[i] << (i + 1 != (int) v.size() ? " " : ""); } return os; } template< typename T > istream &operator>>(istream &is, vector< T > &v) { for(T &in : v) is >> in; return is; } //-tekito- int GCD(int a, int b) {if(b == 0){return a;}return GCD(b,a % b);}//最大公約数 int LCM(int a, int b) {return a/GCD(a, b)*b;}//最小公倍数 ll llsm1(ll n) { return (n * (n + 1)) / 2; }//1~nの総和 int kaijo(int n) {if(n==0||n==1){return 1;}else{return n*kaijo(n - 1);}}//階乗 int ketaSum(int num) {int digit_sum=0;while(num>0){digit_sum+=num%10;num/=10;}return digit_sum;}//各桁の和 string revstr(const string& str) {string reversed=str;reverse(reversed.begin(),reversed.end());return reversed;}//文字列反転 bool isPrime(int n) {if(n<2){return false;}for(int i=2;i*i<=n;i++){if(n%i==0){return false;}}return true;} int getNthPrime(int n) {std::vector<bool> isPrime(1e7, true);isPrime[0] = isPrime[1] = false;int count = 0; int prime = 2;while (count < n) {if (isPrime[prime]) {count++;if (count == n)break;for (int i = prime * 2; i < 1e7; i += prime)isPrime[i] = false;}prime++;}return prime;} long long ppow(int base, int exponent) {long long result=1;while(exponent>0){if(exponent%2==1){result*=base;}base*=base;exponent/=2;}return result;} char getAlp(int a) {if(a>0||a<27){return'A'+a-1;}} char getalp(int a) {if(a>0||a<27){return'a'+a-1;}} int getAlpin(char a) {if(a>='A'||a<='Z'){return a-64;}} int getalpin(char a) {if(a>='a'||a<='z'){return a-96;}} template<class t,class u> bool chmax(t&a,u b) {if(a<b){a=b;return true;}else return false;} template<class t,class u> bool chmin(t&a,u b) {if(b<a){a=b;return true;}else return false;} //-io- void fix(int a){cout << fixed << setprecision(a);} void ent() { cout << "\n";}//print() void OYN(bool a){cout << (a ? "YES" : "NO") << "\n";} void Oyn(bool a){cout << (a ? "Yes" : "No") << "\n";} void oyn(bool a){cout << (a ? "yes" : "no") << "\n";} const string YESNO[2] = {"NO", "YES"};//上 const string YesNo[2] = {"No", "Yes"}; const string yesno[2] = {"no", "yes"}; void print() { cout << '\n'; } template<typename T>//print(a,b,c,...) void print(const T &t) { cout << t << '\n'; } template<typename Head, typename... Tail> void print(const Head &head, const Tail &... tail) { cout << head << ' '; print(tail...); } //----- const int MOD = 998244353; //1+119×2^23 const int INF = 1e9+7; //-search- using Graph = vector<vector<int>>; int dx[8]={1,0,-1,0,1,1,-1,-1}; int dy[8]={0,-1,0,1,-1,1,1,-1}; /*↓↓↓ CODES ↓↓↓*/ /*cin してないやつは愚か*/ int main(){ cin.tie(nullptr); ios::sync_with_stdio(false); int n,x; cin >> n >> x; VI A(n),B(n); rep(i,n){ cin >> A[i] >> B[i]; } REP(i,1,x+1){ int mx = 0; rep(j,n){ mx = max((max(B[j]-abs(i-A[j]),0)),mx); } cout << mx << " "; } }