結果

問題 No.83 最大マッチング
ユーザー sdUrPGRK0kzrYaE
提出日時 2016-02-07 20:47:10
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 330 bytes
コンパイル時間 124 ms
コンパイル使用メモリ 22,528 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-09-21 21:34:05
合計ジャッジ時間 698 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 10
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:4:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    4 |     scanf("%d", &N);
      |     ~~~~~^~~~~~~~~~

ソースコード

diff #

#include<stdio.h>
int main(void) {
    int N, i;
    scanf("%d", &N);
    if (N % 2 == 0) {
        for (i = 1; i <= N / 2; i++)printf("1");
        if (i == N / 2)printf("\n");
    }
    else {
        printf("7");
        for (i = 1; i <= (N - 3) / 2; i++)printf("1");
        if (i == N / 2)printf("\n");
    } 
    return 0;
}
0