結果

問題 No.83 最大マッチング
ユーザー C勉強C勉強
提出日時 2019-02-06 17:13:00
言語 C
(gcc 12.3.0)
結果
AC  
実行時間 1 ms / 5,000 ms
コード長 720 bytes
コンパイル時間 751 ms
コンパイル使用メモリ 28,496 KB
実行使用メモリ 4,372 KB
最終ジャッジ日時 2023-09-02 19:36:34
合計ジャッジ時間 1,525 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,368 KB
testcase_01 AC 1 ms
4,368 KB
testcase_02 AC 1 ms
4,372 KB
testcase_03 AC 0 ms
4,372 KB
testcase_04 AC 0 ms
4,372 KB
testcase_05 AC 1 ms
4,372 KB
testcase_06 AC 1 ms
4,372 KB
testcase_07 AC 1 ms
4,372 KB
testcase_08 AC 0 ms
4,372 KB
testcase_09 AC 1 ms
4,372 KB
testcase_10 AC 1 ms
4,372 KB
testcase_11 AC 1 ms
4,368 KB
testcase_12 AC 1 ms
4,368 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#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