結果

問題 No.478 一般門松列列
ユーザー threecoursethreecourse
提出日時 2018-05-16 11:24:59
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 1,654 bytes
コンパイル時間 2,330 ms
コンパイル使用メモリ 103,584 KB
実行使用メモリ 24,072 KB
最終ジャッジ日時 2023-09-10 22:17:21
合計ジャッジ時間 10,737 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 63 ms
19,872 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 64 ms
19,800 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 64 ms
21,808 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 65 ms
19,944 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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.Web;

namespace Competitive
{
    internal class Solution
    {
        public int N, K;

        public void Run()
        {
            {
                var line = Input.ReadIntArray();
                N = line[0];
                K = line[1];
            }

            List<int> ret = new List<int>();

            for (int i = 0; i < N - K; i++)
            {
                ret.Add(i % 2);
            }

            int last = ret.Last();
            for (int i = N - K; i < N; i++)
            {
                ret.Add(last);
            }

            Console.WriteLine(string.Join(" ", ret));
        }
    }

    // libs ----------
    
    // common ----------

    internal static class Input
    {
        public static int ReadInt()
        {
            string line = Console.ReadLine();
            return int.Parse(line);
        }

        public static int[] ReadIntArray()
        {
            string line = Console.ReadLine();
            return line.Split(' ').Select(int.Parse).ToArray();            
        }

        public static double[] ReadDoubleArray()
        {
            string line = Console.ReadLine();
            return line.Split(' ').Select(double.Parse).ToArray();
        }

        public static long[] ReadLongArray()
        {
            string line = Console.ReadLine();
            return line.Split(' ').Select(long.Parse).ToArray();
        }
    }
    
    internal class Program
    {
        public static void Main(string[] args)
        {
            var s = new Solution();
            s.Run();
        }
    }
}
0