結果
| 問題 | No.2208 Linear Function |
| コンテスト | |
| ユーザー |
nono00
|
| 提出日時 | 2023-02-10 23:09:53 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 3 ms / 2,000 ms |
| コード長 | 564 bytes |
| 記録 | |
| コンパイル時間 | 1,402 ms |
| コンパイル使用メモリ | 208,092 KB |
| 実行使用メモリ | 6,528 KB |
| 最終ジャッジ日時 | 2026-06-29 13:29:40 |
| 合計ジャッジ時間 | 5,226 ms |
|
ジャッジサーバーID (参考情報) |
judge2_1 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 3 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define rep(i, l, r) for (int i = (int)(l); i < (int)(r); i++)
#define rrep(i, r, l) for (int i = (int)(r); i > (int)(l); i--)
#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).rend()
void solve() {
int l, r, a, b;
cin >> l >> r >> a >> b;
if (a == 0) {
cout << b << '\n';
} else if (a > 0) {
cout << (a * r + b) << '\n';
} else {
cout << (a * l + b) << '\n';
}
}
int main() {
int t;
cin >> t;
while (t--) {
solve();
}
}
nono00