結果
問題 | No.2208 Linear Function |
ユーザー | ARCANA |
提出日時 | 2023-07-26 23:36:05 |
言語 | C++14 (gcc 12.3.0 + boost 1.83.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 632 bytes |
コンパイル時間 | 550 ms |
コンパイル使用メモリ | 70,764 KB |
実行使用メモリ | 6,940 KB |
最終ジャッジ日時 | 2024-04-14 13:05:27 |
合計ジャッジ時間 | 1,220 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 2 ms
6,816 KB |
testcase_01 | WA | - |
testcase_02 | AC | 4 ms
6,940 KB |
testcase_03 | WA | - |
ソースコード
#include <iostream> #include <vector> #include <algorithm> using namespace std; struct TestCase { int L; int R; int A; int B; /* data */ }; int main(){ // input int T; cin >> T; TestCase cases[T+1]; for(int i=1;i<=T;i++){ cin >> cases[i].L >> cases[i].R >> cases[i].A >> cases[i].B ; } int ans[T+1]; for(int i=1;i<=T;i++){ if(cases[i].A > 0){ ans[i] = cases[i].A * cases[i].R + cases[i].B; } else if(cases[i].A < 0){ ans[i] = cases[i].A * cases[i].L + cases[i].B; } else { ans[i] = 0; } } for(int i=1;i<=T;i++){ cout << ans[i] << endl; } // output }