結果
問題 | No.2208 Linear Function |
ユーザー |
|
提出日時 | 2023-02-11 14:18:44 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 2,000 ms |
コード長 | 960 bytes |
コンパイル時間 | 3,651 ms |
コンパイル使用メモリ | 250,940 KB |
最終ジャッジ日時 | 2025-02-10 14:22:39 |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 3 |
ソースコード
#include <bits/stdc++.h>#include <atcoder/all>#define rep(i, n) for (int i = 0; i < (int)(n); i++)#define rrep(i, n, m) for (int i = (int)(n); i > (int)(m); i--)using namespace atcoder;using ll = long long;const ll MOD1 = 1000000007LL;const ll MOD2 = 998244353LL;using namespace std;const vector<pair<int, int>> dpos4 = {{1, 0}, {0, 1}, {-1, 0}, {0, -1}};// const vector<pair<int, int>> dpos8 = {{-1, -1}, {-1, 0}, {-1, 1}, {0, -1}, {0, 1}, {1, -1}, {1, 0}, {1, 1}};template <typename T>bool chmax(T &a, const T &b) {if (a < b) {a = b; // aをbで更新return true;}return false;}template <typename T>bool chmin(T &a, const T &b) {if (a > b) {a = b; // aをbで更新return true;}return false;}int main() {int T;cin >> T;rep(i, T){ll L, R, A, B;cin >> L >> R >> A >> B;cout << max(L * A + B, R * A + B) << endl;}return 0;}