結果

問題 No.83 最大マッチング
ユーザー bayashiko_r
提出日時 2018-11-08 00:57:24
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 637 bytes
コンパイル時間 821 ms
コンパイル使用メモリ 103,424 KB
実行使用メモリ 18,048 KB
最終ジャッジ日時 2024-11-20 20:55:25
合計ジャッジ時間 1,450 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 6 WA * 4
権限があれば一括ダウンロードができます
コンパイルメッセージ
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