結果

問題 No.2208 Linear Function
ユーザー 👑 OnjoujiTokiOnjoujiToki
提出日時 2023-02-10 21:21:41
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 733 bytes
コンパイル時間 1,186 ms
コンパイル使用メモリ 127,132 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-21 22:21:11
合計ジャッジ時間 1,675 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 2 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <chrono>
#include <cmath>
#include <complex>
#include <cstdint>
#include <cstring>
#include <ctime>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <unordered_map>
#include <unordered_set>

void solve() {
  int t;
  std::cin >> t;
  while (t--) {
    int l, r, a, b;
    std::cin >> l >> r >> a >> b;
    long long ans = 0;
    ans = std::max(l * a + b, r * a + b);
    std::cout << ans << '\n';
  }
}

int main() {
  std::ios::sync_with_stdio(false);
  std::cin.tie(nullptr);

  int t = 1;
  // std::cin >> t;

  while (t--) solve();
  return 0;
}
0