結果

問題 No.851 テストケース
ユーザー ππ
提出日時 2019-07-26 22:41:34
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 1,232 bytes
コンパイル時間 3,723 ms
コンパイル使用メモリ 197,836 KB
実行使用メモリ 4,504 KB
最終ジャッジ日時 2023-09-15 02:38:41
合計ジャッジ時間 4,074 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 1 ms
4,376 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 2 ms
4,380 KB
testcase_20 AC 2 ms
4,376 KB
testcase_21 WA -
testcase_22 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define INF 1000000000
#define MOD 1000000007
#define FOR(i, a, b) for(int i = (int)(a); i < (int)(b); i++)
#define REP(i, b) FOR(i, 0, b)
#define ALL(x) (x).begin(),(x).end()
typedef long long ll;

int main() {
  char c;
  string s;
  ll p[3];
  scanf("%*s%*[\n]");
  for(int i = 0; i < 3;){
    scanf("%c", &c);
    if(c == ' ') {
      cout << "\"assert\"" << endl;
      return 0;
    }
    if(c == '\n') {
      i++;
    }
    s += c;
  }
  sscanf(&s[0], "%d%d%d", p, p + 1, p + 2);
  if(p[0] == p[1]) {
    cout << ((p[0] * 2 < p[0] + p[2]) ? p[0] * 2 : p[0] + p[2]) << endl;
    return 0;
  } else {
    ll a[3], q[3];
    a[0] = p[0] + p[1];
    a[1] = p[1] + p[2];
    a[2] = p[2] + p[0];
    q[0] = a[0] < a[1];
    q[1] = a[1] < a[2];
    q[2] = a[2] < a[0];
    if(a[0] == a[1]) {
      cout << ((a[0] < a[2]) ? a[0] : a[2]);
    } else if(a[1] == a[2]) {
      cout << ((a[1] < a[0]) ? a[1] : a[0]);
    } else if(a[2] == a[0]) {
      cout << ((a[2] < a[1]) ? a[2] : a[1]);
    } else if(q[0] == q[2]) {
      cout << a[0] << endl;
    } else if(q[0] == q[1]) {
      cout << a[1] << endl;
    } else if(q[1] == q[2]) {
      cout << a[2] << endl;
    }
  }
  return 0;
}
0