結果

問題 No.83 最大マッチング
ユーザー Himatsubushin
提出日時 2021-07-25 09:31:42
言語 C90
(gcc 12.3.0)
結果
WA  
実行時間 -
コード長 252 bytes
コンパイル時間 500 ms
コンパイル使用メモリ 21,120 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-20 16:55:52
合計ジャッジ時間 1,260 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 6 WA * 4
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:7:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    7 |         scanf("%d", &n);
      |         ^~~~~~~~~~~~~~~

ソースコード

diff #

#include <stdio.h>
#include <stdlib.h>

int main() {
	int n, k, i, j = 1, s = 0;

	scanf("%d", &n);
	k = n / 2;
	for (i = 0; i < k; i++) {
		s = s * 10 + 1;
		j *= 10;
	}
	if (n % 2 == 1)
		s += 6 * j / 10;
	printf("%d\n", s);

	return EXIT_SUCCESS;
}
0