結果

問題 No.83 最大マッチング
ユーザー umashikaumashika
提出日時 2016-02-22 03:57:20
言語 C90
(gcc 11.4.0)
結果
TLE  
実行時間 -
コード長 723 bytes
コンパイル時間 142 ms
コンパイル使用メモリ 21,408 KB
実行使用メモリ 5,712 KB
最終ジャッジ日時 2023-10-23 19:02:23
合計ジャッジ時間 6,695 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 0 ms
4,348 KB
testcase_01 AC 0 ms
4,348 KB
testcase_02 AC 1 ms
4,348 KB
testcase_03 AC 1 ms
4,348 KB
testcase_04 AC 1 ms
4,348 KB
testcase_05 AC 1 ms
4,348 KB
testcase_06 AC 0 ms
4,348 KB
testcase_07 AC 1 ms
4,348 KB
testcase_08 TLE -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:8:3: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    8 |   scanf("%d",&n);
      |   ^~~~~~~~~~~~~~

ソースコード

diff #

#include<stdio.h>
int main()
{
  int n;
  int i,j;
  int ans;
  int q;
  scanf("%d",&n);
  while(n>0){
    if(n==2){ans=1;n=0;}        //2            //8
    else if(n==3){ans=7;n=0;}    //3            //7
    else if(n==4){ans=11;n=0;}  //2,2に分ける  //6
    else if(n==5){ans=71;n=0;}  //3,2          //5
    else if(n==6){ans=111;n=0;} //2,2,2        //3
    else if(n==7){ans=711;n=0;}  //3,4          //4
    else if(n==8){ans=1111;n=0;}//2,2,2,2      //2
    else if(n==9){ans=7111;n=0;} //3,2,2,2     //1
    else{
        q = n/9;//1111がqこ作れる
        n = n%9;
      }
  }
    //答えはans 1111がqこ
  printf("%d",ans);
  for(i=0;i<q;i++){
    printf("1111");
  }
  printf("\n");
  return 0;
}



0