結果

問題 No.83 最大マッチング
ユーザー TomoProgTomoProg
提出日時 2018-10-03 21:04:40
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 1,760 ms / 5,000 ms
コード長 798 bytes
コンパイル時間 871 ms
コンパイル使用メモリ 108,144 KB
実行使用メモリ 40,832 KB
最終ジャッジ日時 2024-04-20 14:51:00
合計ジャッジ時間 5,911 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 18 ms
17,664 KB
testcase_01 AC 20 ms
17,280 KB
testcase_02 AC 22 ms
17,792 KB
testcase_03 AC 19 ms
17,792 KB
testcase_04 AC 18 ms
17,664 KB
testcase_05 AC 19 ms
17,664 KB
testcase_06 AC 18 ms
17,664 KB
testcase_07 AC 19 ms
17,792 KB
testcase_08 AC 20 ms
17,536 KB
testcase_09 AC 41 ms
39,296 KB
testcase_10 AC 876 ms
40,576 KB
testcase_11 AC 1,760 ms
40,576 KB
testcase_12 AC 1,668 ms
40,832 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication2
{
    class Program
    {
        static void Main(string[] args)
        {
            var matchNum = int.Parse(Console.ReadLine());
            var oneNum = matchNum / 2;
            var sevenFlag = matchNum % 2 == 1;
            var result = "";

            for(int i = 0; i < oneNum; i++)
            {
                result += "1";
            }

            if(sevenFlag)
            {
                result = result.Insert(0, "7");
                if(oneNum >= 1)
                {
                    result = result.Substring(0, result.Length - 1);
                }
            }

            Console.WriteLine(result);
        }
    }
}
0