結果

問題 No.83 最大マッチング
ユーザー nuwasoginuwasogi
提出日時 2015-11-22 17:00:41
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 56 ms / 5,000 ms
コード長 1,470 bytes
コンパイル時間 2,114 ms
コンパイル使用メモリ 101,456 KB
実行使用メモリ 22,752 KB
最終ジャッジ日時 2023-10-11 18:13:32
合計ジャッジ時間 3,502 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 53 ms
22,752 KB
testcase_01 AC 53 ms
20,772 KB
testcase_02 AC 53 ms
22,732 KB
testcase_03 AC 52 ms
20,672 KB
testcase_04 AC 54 ms
22,688 KB
testcase_05 AC 55 ms
18,676 KB
testcase_06 AC 56 ms
20,684 KB
testcase_07 AC 53 ms
18,716 KB
testcase_08 AC 54 ms
20,776 KB
testcase_09 AC 55 ms
22,664 KB
testcase_10 AC 55 ms
20,692 KB
testcase_11 AC 53 ms
18,632 KB
testcase_12 AC 54 ms
20,728 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;

namespace Saidai_Matching
{
    class Program
    {
        static void Main(string[] args)
        {
            int N = int.Parse(Console.ReadLine());

            if (N % 2 == 1)
            {
                Console.Write('7');
                N -= 3;
            }
            int onenum = N / 2;
            if (N < 100)
            {
                for (; onenum > 0; onenum--)
                {
                    Console.Write('1');
                }
            }
            else
            {
                string buf = "11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111";
                for (int roop = onenum / buf.Length; roop > 0; roop--)
                {
                    Console.Write(buf);
                }
                
                for (int onenum_remain = onenum % buf.Length; onenum_remain > 0; onenum_remain--)
                {
                    Console.Write('1');
                }
            }
            Console.WriteLine();
        }
    }
}
0