結果

問題 No.3287 Golden Ring
ユーザー pengin_2000
提出日時 2025-10-03 21:49:51
言語 C
(gcc 13.3.0)
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 282 bytes
コンパイル時間 1,088 ms
コンパイル使用メモリ 26,672 KB
実行使用メモリ 7,716 KB
最終ジャッジ日時 2025-10-03 21:49:58
合計ジャッジ時間 1,690 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 14
権限があれば一括ダウンロードができます
コンパイルメッセージ
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);
      |         ^~~~~~~~~~~~~~~

ソースコード

diff #

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