結果

問題 No.851 テストケース
ユーザー pengin_2000pengin_2000
提出日時 2020-02-20 01:32:29
言語 C
(gcc 12.3.0)
結果
WA  
実行時間 -
コード長 609 bytes
コンパイル時間 147 ms
コンパイル使用メモリ 31,232 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-17 06:14:05
合計ジャッジ時間 984 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include<stdio.h>
int main()
{
	int n;
	scanf("%d", &n);
	int i, j;
	long long int a[3];
	char c[3];
	scanf("%c", &c[0]);
	for (i = 0; i < n; i++)
		scanf("%lld%c", &a[i], &c[i]);
	if (c[0] == ' ' || c[1] == ' ' || c[2] == ' ')
	{
		printf("assert\n");
		return 0;
	}
	long long int b[10];
	for (i = 0; i < n; i++)
		for (j = 0; j < n; j++)
			b[n * i + j] = a[i] + a[j];
	for (i = 0; i < n * n - 1; i++)
	{
		if (b[i] < b[i + 1])
		{
			b[i + 1] ^= b[i];
			b[i] ^= b[i + 1];
			b[i + 1] ^= b[i];
			if (i > 0)
				i -= 2;
		}
	}
	i = 2;
	while (b[i] == b[i - 1])
		i++;
	printf("%lld\n", b[i]);
	return 0;
}
0