結果

問題 No.851 テストケース
ユーザー bal4ubal4u
提出日時 2019-07-26 22:03:54
言語 C
(gcc 12.3.0)
結果
AC  
実行時間 1 ms / 3,153 ms
コード長 747 bytes
コンパイル時間 1,280 ms
コンパイル使用メモリ 27,924 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-15 01:27:59
合計ジャッジ時間 1,100 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 0 ms
4,380 KB
testcase_01 AC 0 ms
4,376 KB
testcase_02 AC 0 ms
4,380 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 0 ms
4,380 KB
testcase_05 AC 0 ms
4,376 KB
testcase_06 AC 1 ms
4,380 KB
testcase_07 AC 1 ms
4,380 KB
testcase_08 AC 0 ms
4,380 KB
testcase_09 AC 1 ms
4,380 KB
testcase_10 AC 1 ms
4,380 KB
testcase_11 AC 0 ms
4,384 KB
testcase_12 AC 0 ms
4,380 KB
testcase_13 AC 1 ms
4,376 KB
testcase_14 AC 0 ms
4,380 KB
testcase_15 AC 0 ms
4,380 KB
testcase_16 AC 1 ms
4,380 KB
testcase_17 AC 1 ms
4,376 KB
testcase_18 AC 0 ms
4,380 KB
testcase_19 AC 1 ms
4,380 KB
testcase_20 AC 1 ms
4,380 KB
testcase_21 AC 1 ms
4,376 KB
testcase_22 AC 1 ms
4,380 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: 関数 ‘in’ 内:
main.c:9:14: 警告: 関数 ‘getchar_unlocked’ の暗黙的な宣言です [-Wimplicit-function-declaration]
    9 | #define gc() getchar_unlocked()
      |              ^~~~~~~~~~~~~~~~
main.c:15:27: 備考: in expansion of macro ‘gc’
   15 |         ll n = 0; int c = gc();
      |                           ^~

ソースコード

diff #

// 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