結果
問題 | No.2138 Add Bacon |
ユーザー | Sarievo |
提出日時 | 2022-12-01 12:02:44 |
言語 | C++17 (gcc 12.3.0 + boost 1.83.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 2,765 bytes |
コンパイル時間 | 5,621 ms |
コンパイル使用メモリ | 323,088 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-04-27 04:17:48 |
合計ジャッジ時間 | 6,346 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 2 ms
6,816 KB |
testcase_01 | AC | 2 ms
6,944 KB |
testcase_02 | AC | 2 ms
6,944 KB |
testcase_03 | AC | 1 ms
6,940 KB |
testcase_04 | AC | 2 ms
6,940 KB |
testcase_05 | AC | 2 ms
6,940 KB |
testcase_06 | AC | 1 ms
6,940 KB |
testcase_07 | AC | 1 ms
6,940 KB |
testcase_08 | AC | 1 ms
6,940 KB |
testcase_09 | AC | 1 ms
6,940 KB |
testcase_10 | AC | 1 ms
6,940 KB |
testcase_11 | AC | 1 ms
6,944 KB |
testcase_12 | AC | 1 ms
6,940 KB |
testcase_13 | AC | 1 ms
6,940 KB |
testcase_14 | AC | 2 ms
6,944 KB |
testcase_15 | AC | 1 ms
6,940 KB |
testcase_16 | AC | 1 ms
6,944 KB |
testcase_17 | AC | 1 ms
6,940 KB |
testcase_18 | AC | 2 ms
6,944 KB |
testcase_19 | AC | 2 ms
6,940 KB |
testcase_20 | AC | 2 ms
6,940 KB |
testcase_21 | AC | 2 ms
6,944 KB |
testcase_22 | AC | 2 ms
6,940 KB |
testcase_23 | AC | 2 ms
6,944 KB |
testcase_24 | AC | 1 ms
6,944 KB |
testcase_25 | AC | 1 ms
6,944 KB |
testcase_26 | AC | 2 ms
6,944 KB |
ソースコード
// @Sarievo, URL: https://yukicoder.me/problems/no/2138 #pragma GCC target("avx2") #pragma GCC optimize("O3","unroll-loops") #include <bits/stdc++.h> using namespace std; // --- Library --- #if __has_include(<atcoder/all>) #include <atcoder/all> using namespace atcoder; // using mint=modint998244353; using mint=modint1000000007; #endif // --- Type and Alias --- #define a first #define b second #include <ext/pb_ds/tree_policy.hpp> #include <ext/pb_ds/assoc_container.hpp> using namespace __gnu_pbds; // find_by_order() - kth largest (0-indexed) // order_of_key() - count(Si < k) template<class T> using indexed_set=tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>; template<class T> using indexed_multiset=tree<T,null_type,less_equal<T>,rb_tree_tag,tree_order_statistics_node_update>; template<class T> using v=vector<T>; template<class T> using vv=v<v<T>>; template<class T> using minheap=priority_queue<T,v<T>,greater<T>>; template<class T> using maxheap=priority_queue<T,v<T>,less<T>>; using ll=long long; using ld=long double; using vl=v<ll>; using vvl=vv<ll>; using pl=pair<ll,ll>; using vp=v<pl>; // --- IO --- template<typename T> istream&operator>>(istream&is, pair<T,T>&p){is>>p.a>>p.b;return is;} template<typename T> ostream&operator<<(ostream&os, pair<T,T>&p){os<<p.a<<" "<<p.b;return os;} template<typename T> istream&operator>>(istream&is, v<T>&a){for(auto&e:a)is>>e;return is;} template<typename T> ostream&operator<<(ostream&os, v<T>&a){for(auto&e:a)os<<e<<" ";return os;} #define Nya ios_base::sync_with_stdio(0);std::cin.tie(0);std::cout.tie(0);std::cout<<fixed; // --- Macro --- #define reps(i,start,end_exclusive) for(ll i=(ll)(start);i<(ll)(end_exclusive);++i) #define rep(i,end_exclusive) reps(i,0,end_exclusive) #define sum(a) accumulate(all(a),0ll) #define fore(e,a) for(auto&e:a) #define all(a) (a).begin(),(a).end() #define rall(a) (a).rbegin(),(a).rend() template<class T> auto min(const T&a){return *min_element(all(a));} template<class T> auto max(const T&a){return *max_element(all(a));} template<class T,class U> bool chmax(T&x,const U&y){return x<y?x=y,1:0;} template<class T,class U> bool chmin(T&x,const U&y){return x>y?x=y,1:0;} template<typename T> inline T abs(const T&x){return (x<0?-x:x);} template<typename T> inline T sqr(const T&x){return (x*x);} void yes(bool x){std::cout<<(x?"yes":"no")<<endl;} void Yes(bool x){std::cout<<(x?"Yes":"No")<<endl;} void YES(bool x){std::cout<<(x?"YES":"NO")<<endl;} // --- Vars --- // R D L U DR DL UL UR ll dx[]{+0,+1,+0,-1,+1,+1,-1,-1}; ll dy[]{+1,+0,-1,+0,+1,-1,-1,+1}; void solve(){ ll a, b, c, d, e; cin >> a >> b >> c >> d >> e; ll base = a-b; if (d-e > 0) base += c * (d-e); cout << base << endl; } signed main(){ Nya; solve(); }