結果

問題 No.3387 23578 Sequence
コンテスト
ユーザー pengin_2000
提出日時 2025-11-28 21:23:50
言語 C
(gcc 13.3.0)
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 282 bytes
コンパイル時間 195 ms
コンパイル使用メモリ 26,576 KB
実行使用メモリ 7,852 KB
最終ジャッジ日時 2025-11-28 21:23:51
合計ジャッジ時間 1,428 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 28
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:6:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    6 |         scanf("%d", &n);
      |         ^~~~~~~~~~~~~~~
main.c:9:17: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    9 |                 scanf("%d", &a[i]);
      |                 ^~~~~~~~~~~~~~~~~~

ソースコード

diff #
raw source code

#include<stdio.h>
int a[102];
int main()
{
	int n;
	scanf("%d", &n);
	int i;
	for (i = 0; i < n; i++)
		scanf("%d", &a[i]);
	int f = 0;
	for (i = 0; i < n; i++)
		if (a[i] + a[n - i - 1] != a[0] + a[n - 1])
			f++;
	if (f > 0)
		printf("No\n");
	else
		printf("Yes\n");
	return 0;
}
0