結果

問題 No.83 最大マッチング
ユーザー bayashiko_rbayashiko_r
提出日時 2018-11-08 00:57:24
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 637 bytes
コンパイル時間 1,981 ms
コンパイル使用メモリ 102,424 KB
実行使用メモリ 23,324 KB
最終ジャッジ日時 2023-08-13 04:13:30
合計ジャッジ時間 3,547 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 54 ms
21,116 KB
testcase_01 AC 55 ms
20,988 KB
testcase_02 AC 56 ms
23,092 KB
testcase_03 AC 55 ms
20,916 KB
testcase_04 AC 55 ms
18,976 KB
testcase_05 AC 55 ms
20,940 KB
testcase_06 AC 56 ms
23,212 KB
testcase_07 AC 55 ms
21,180 KB
testcase_08 AC 55 ms
21,236 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;

class Program {
    static void Main(string[] args) {
        //入力
        long N = long.Parse(Console.ReadLine());

        //出力する数字
        long ans = 0;

        //Nが偶数の時
        if (N % 2 == 0) {
            for (long i = 0; i < N / 2; i++) {
                ans += (long)Math.Pow(10, i);
            }
        //Nが奇数の時
        } else if (N % 2 == 1) {
            for (long i = 0; i < N / 2; i++) {
                ans += (long)Math.Pow(10, i);
            }
            ans += 6 * (long)Math.Pow(10, N / 2 - 1);
        }

        //出力
        Console.WriteLine(ans);
    }
}
0