結果

問題 No.851 テストケース
コンテスト
ユーザー bal4u
提出日時 2019-07-26 22:03:54
言語 C(gnu17)
(gcc 15.2.0)
コンパイル:
gcc-15 -O2 -std=gnu17 -Wno-error=implicit-function-declaration -Wno-error=implicit-int -Wno-error=incompatible-pointer-types -Wno-error=int-conversion -DONLINE_JUDGE -o a.out _filename_ -lm
実行:
./a.out
結果
AC  
実行時間 1 ms / 3,153 ms
コード長 747 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 149 ms
コンパイル使用メモリ 38,624 KB
最終ジャッジ日時 2026-02-22 03:59:53
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

// yukicoder: No.851 テストケース
// 2019.7.26 bal4u

#include <stdio.h>

typedef long long ll;

#if 1
#define gc() getchar_unlocked()
#else
#define gc() getchar()
#endif

ll in() {   // 非負整数の入力
	ll n = 0; int c = gc();
	while (1) {
		n = 10 * n + (c & 0xf);
		if ((c = gc()) == ' ') return -1;
		if (c < ' ') break;
	}
	return n;
}

int main()
{
	int i; ll a[3], t, b, c, d;

	if (in() < 0) goto err;
	for (i = 0; i < 3; i++) {
		if ((a[i] = in()) < 0) goto err;
	}
	b = a[0] + a[1], c = a[0] + a[2], d = a[1] + a[2];
	if (b < c) t = b, b = c, c = t;
	if (c < d) t = c, c = d, d = t;
	if (b < c) t = b, b = c, c = t;
	if (c != b) printf("%lld\n", c); else printf("%lld\n", d);
	return 0;
err: puts("\"assert\"");
	return 0;
}
0