結果
問題 |
No.2175 Exciting Combo
|
ユーザー |
![]() |
提出日時 | 2022-08-23 13:09:38 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 430 bytes |
コンパイル時間 | 860 ms |
コンパイル使用メモリ | 67,352 KB |
最終ジャッジ日時 | 2025-01-31 03:04:19 |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 7 |
ソースコード
#include <iostream> #define rep(i, l, n) for (int i = (l); i < (n); i++) using namespace std; int main(void) { int a1, a2, a3, b; cin >> a1 >> a2 >> a3 >> b; int a[3] = { a1,a2,a3 }; int ans = 0; rep(i, 0, 3) { rep(j, 0, 3) { rep(k, 0, 3) { int damage = a[i] + a[j] + a[k]; if (i == 0 and j == 1 and k == 2) { damage += b; } ans = max(ans, damage); } } } cout << ans << endl; return 0; }