結果

問題 No.629 グラフの中に眠る門松列
ユーザー pengin_2000pengin_2000
提出日時 2021-10-31 09:31:30
言語 C
(gcc 12.3.0)
結果
WA  
実行時間 -
コード長 652 bytes
コンパイル時間 126 ms
コンパイル使用メモリ 30,848 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-17 01:41:07
合計ジャッジ時間 3,212 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
5,248 KB
testcase_01 AC 1 ms
5,376 KB
testcase_02 AC 1 ms
5,376 KB
testcase_03 AC 1 ms
5,376 KB
testcase_04 AC 1 ms
5,376 KB
testcase_05 AC 1 ms
5,376 KB
testcase_06 AC 1 ms
5,376 KB
testcase_07 WA -
testcase_08 AC 1 ms
5,376 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
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 AC 1 ms
5,376 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 76 ms
5,376 KB
testcase_23 WA -
testcase_24 AC 2 ms
5,376 KB
testcase_25 AC 2 ms
5,376 KB
testcase_26 AC 2 ms
5,376 KB
testcase_27 AC 90 ms
5,376 KB
testcase_28 WA -
testcase_29 AC 90 ms
5,376 KB
testcase_30 AC 95 ms
5,376 KB
testcase_31 AC 98 ms
5,376 KB
testcase_32 AC 110 ms
5,376 KB
testcase_33 WA -
testcase_34 AC 104 ms
5,376 KB
testcase_35 AC 99 ms
5,376 KB
testcase_36 AC 86 ms
5,376 KB
testcase_37 WA -
testcase_38 AC 111 ms
5,376 KB
testcase_39 AC 92 ms
5,376 KB
testcase_40 WA -
testcase_41 AC 90 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<stdio.h>
int main()
{
	int n, m;
	scanf("%d %d", &n, &m);
	int i, j, k;
	int a[1003];
	for (i = 0; i < n; i++)
		scanf("%d", &a[i]);
	int u, v;
	int d[1003][1003];
	for (i = 0; i < n; i++)
		for (j = 0; j < n; j++)
			d[i][j] = 0;
	for (i = 0; i < m; i++)
	{
		scanf("%d %d", &u, &v);
		d[u - 1][v - 1] = d[v - 1][u - 1] = 1;
	}
	int f = 0;
	for (i = 0; i < n; i++)
	{
		for (j = i + 1; j < n; j++)
		{
			for (k = j + 1; k < n; k++)
			{
				if (a[k] == a[i])
					continue;
				if (a[i]<a[j] && a[j]>a[k])
					f++;
				if (a[i] > a[j] && a[j] < a[k])
					f++;
			}
		}
	}
	if (f > 0)
		printf("YES\n");
	else
		printf("NO\n");
	return 0;
}
0