結果

問題 No.83 最大マッチング
コンテスト
ユーザー C勉強
提出日時 2019-02-06 17:13:00
言語 C(gnu17)
(gcc 15.2.0)
コンパイル:
gcc-15 -O2 -std=gnu17 -Wno-error=implicit-function-declaration -Wno-error=implicit-int -Wno-error=incompatible-pointer-types -Wno-error=int-conversion -DONLINE_JUDGE -o a.out _filename_ -lm
実行:
./a.out
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 720 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 174 ms
コンパイル使用メモリ 38,848 KB
最終ジャッジ日時 2026-02-22 02:26:42
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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

void calc_match_max_value(int digit, int seven_flg, char *max_value);

int main(void)
{
    int i_match_count = 0;
    int i_max_value = 0;
    
    char *chr_max_value;
    
    scanf("%d", &i_match_count);
    
    chr_max_value = (char *)malloc((i_match_count/2) * sizeof(char));
    calc_match_max_value(i_match_count/2, i_match_count % 2, chr_max_value);
    
    printf("%s\n", chr_max_value);
}

void calc_match_max_value(int digit, int seven_flg, char *max_value){
    int i;
    
    if(seven_flg == 1){
        max_value[0] = '7';
    } else {
        max_value[0] = '1';
    }
    
    for(i = 1; i < digit; i++){
        max_value[i] = '1';
    }
}
0