結果

問題 No.2208 Linear Function
ユーザー pengin_2000pengin_2000
提出日時 2023-05-01 23:36:50
言語 C
(gcc 12.3.0)
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 270 bytes
コンパイル時間 245 ms
コンパイル使用メモリ 28,160 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-30 21:20:20
合計ジャッジ時間 755 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include<stdio.h>
void solve()
{
	int l, r, a, b;
	scanf("%d %d %d %d", &l, &r, &a, &b);
	int ans;
	if (a < 0)
		ans = a * l + b;
	else
		ans = a * r + b;
	printf("%d\n", ans);
	return;
}
int main()
{
	int t;
	scanf("%d", &t);
	for (; t > 0; t--)
		solve();
	return 0;
}
0