結果

問題 No.851 テストケース
ユーザー ππ
提出日時 2019-07-26 22:27:11
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,009 bytes
コンパイル時間 3,277 ms
コンパイル使用メモリ 198,528 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-15 02:18:24
合計ジャッジ時間 3,411 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 1 ms
4,380 KB
testcase_06 AC 2 ms
4,376 KB
testcase_07 AC 1 ms
4,376 KB
testcase_08 AC 1 ms
4,380 KB
testcase_09 AC 2 ms
4,376 KB
testcase_10 AC 2 ms
4,380 KB
testcase_11 AC 2 ms
4,376 KB
testcase_12 AC 1 ms
4,376 KB
testcase_13 AC 1 ms
4,376 KB
testcase_14 AC 1 ms
4,376 KB
testcase_15 AC 1 ms
4,380 KB
testcase_16 AC 1 ms
4,380 KB
testcase_17 WA -
testcase_18 AC 2 ms
4,376 KB
testcase_19 AC 2 ms
4,380 KB
testcase_20 AC 1 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;
  int 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 {
    int 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(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