結果

問題 No.83 最大マッチング
ユーザー UK_kkbjUK_kkbj
提出日時 2017-06-16 15:03:03
言語 C
(gcc 12.3.0)
結果
WA  
実行時間 -
コード長 494 bytes
コンパイル時間 136 ms
コンパイル使用メモリ 31,488 KB
実行使用メモリ 6,676 KB
最終ジャッジ日時 2024-04-08 13:32:27
合計ジャッジ時間 732 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <stdio.h>
#include <math.h>

double match(int N){
    double ans = 0;
    double i;
    switch(N % 2){
        case 0 :for(i = 0; i <= N/2 - 1; i++){
                    ans += pow(10,i);
                }
                break;
        case 1 :for(i = 0; i <= N/2 - 2; i++){
                    ans += pow(10,i);
                }   ans += 7 * pow(10,i);   break;
    }
return ans;
}

int main(void){
    double n;
    scanf("%lf", &n);
    printf("%.0f\n",match(n));
    return 0;
}
0