結果
問題 | No.83 最大マッチング |
ユーザー |
![]() |
提出日時 | 2019-02-06 17:13:00 |
言語 | C (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 1 ms / 5,000 ms |
コード長 | 720 bytes |
コンパイル時間 | 1,252 ms |
コンパイル使用メモリ | 28,416 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-12 02:00:26 |
合計ジャッジ時間 | 1,426 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 10 |
ソースコード
#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';}}