結果

問題 No.83 最大マッチング
ユーザー bayashiko_rbayashiko_r
提出日時 2018-11-08 01:18:33
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 2,159 ms / 5,000 ms
コード長 663 bytes
コンパイル時間 889 ms
コンパイル使用メモリ 103,424 KB
実行使用メモリ 40,832 KB
最終ジャッジ日時 2024-04-30 22:36:23
合計ジャッジ時間 7,333 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 22 ms
17,408 KB
testcase_01 AC 23 ms
17,408 KB
testcase_02 AC 23 ms
17,408 KB
testcase_03 AC 23 ms
17,408 KB
testcase_04 AC 22 ms
17,408 KB
testcase_05 AC 22 ms
17,536 KB
testcase_06 AC 24 ms
17,664 KB
testcase_07 AC 24 ms
17,664 KB
testcase_08 AC 22 ms
17,408 KB
testcase_09 AC 45 ms
39,424 KB
testcase_10 AC 1,119 ms
40,704 KB
testcase_11 AC 2,159 ms
40,832 KB
testcase_12 AC 2,152 ms
40,448 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
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) {
        //入力
        ulong N = ulong.Parse(Console.ReadLine());

        //出力する数字
        string ans = "";

        //Nが偶数の時
        if (N % 2 == 0) {
            for (ulong i = 0; i < N / 2; i++) {
                ans += "1";
            }
        //Nが奇数の時
        } else if (N % 2 == 1) {
            for (ulong i = 0; i < N / 2; i++) {
                if (i == 0) {
                    ans += "7";
                } else {
                    ans += "1";
                }
            }
        }

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