結果

問題 No.909 たぴの配置
ユーザー tomomo2b2tomomo2b2
提出日時 2019-10-18 21:34:06
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 285 ms / 3,000 ms
コード長 918 bytes
コンパイル時間 3,919 ms
コンパイル使用メモリ 105,412 KB
実行使用メモリ 59,204 KB
最終ジャッジ日時 2023-09-07 21:30:49
合計ジャッジ時間 8,307 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 62 ms
21,752 KB
testcase_01 AC 63 ms
23,716 KB
testcase_02 AC 62 ms
21,780 KB
testcase_03 AC 62 ms
21,800 KB
testcase_04 AC 62 ms
21,772 KB
testcase_05 AC 268 ms
56,448 KB
testcase_06 AC 280 ms
57,884 KB
testcase_07 AC 262 ms
54,780 KB
testcase_08 AC 277 ms
54,016 KB
testcase_09 AC 285 ms
59,204 KB
testcase_10 AC 266 ms
54,664 KB
testcase_11 AC 265 ms
54,316 KB
testcase_12 AC 265 ms
57,732 KB
testcase_13 AC 272 ms
54,516 KB
testcase_14 AC 267 ms
54,732 KB
testcase_15 AC 266 ms
54,288 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.Linq;
using System.Collections.Generic;
using System.IO;

class MyClass
{
    public static void Solve()
    {
        var N = int.Parse(Console.ReadLine());
        var X = Console.ReadLine().Split().Select(int.Parse).ToArray();
        var Y = Console.ReadLine().Split().Select(int.Parse).ToArray();
        var min = Enumerable.Range(0, N).Select(i => X[i] + Y[i]).Min();
        Console.WriteLine(min);
        var pos = new int[N + 2];
        pos[0] = 0;
        pos[N + 1] = min;
        for (int i = 0; i < N; i++)
        {
            pos[i + 1] = Math.Min(X[i], min);
        }
        foreach (var item in pos)
        {
            Console.WriteLine(item);
        }
    }

    public static void Main()
    {
        var sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
        Console.SetOut(sw);
        Solve();
        Console.Out.Flush();
    }
}
0