結果

問題 No.2208 Linear Function
ユーザー warm4C0warm4C0
提出日時 2023-05-06 23:20:37
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 4 ms / 2,000 ms
コード長 270 bytes
コンパイル時間 1,433 ms
コンパイル使用メモリ 157,668 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-05-03 06:05:30
合計ジャッジ時間 2,020 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

int f(int a, int b, int x) {
	return a*x + b;
}

int main() {
	int t;
	cin >> t;

	for (int i = 0; i < t; i++) {
		int l, r, a, b;
		cin >> l >> r >> a >> b;

		cout << max(f(a, b, l), f(a, b, r)) << endl;
	}

	return 0;
}
0