結果

問題 No.909 たぴの配置
ユーザー iwkjoseciwkjosec
提出日時 2019-10-19 02:53:54
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 132 ms / 3,000 ms
コード長 1,713 bytes
コンパイル時間 2,929 ms
コンパイル使用メモリ 106,076 KB
実行使用メモリ 27,684 KB
最終ジャッジ日時 2023-09-08 09:25:25
合計ジャッジ時間 7,510 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 49 ms
20,480 KB
testcase_01 AC 49 ms
20,368 KB
testcase_02 AC 50 ms
22,416 KB
testcase_03 AC 49 ms
22,412 KB
testcase_04 AC 49 ms
22,416 KB
testcase_05 AC 123 ms
27,640 KB
testcase_06 AC 126 ms
25,744 KB
testcase_07 AC 120 ms
27,552 KB
testcase_08 AC 128 ms
27,624 KB
testcase_09 AC 132 ms
23,668 KB
testcase_10 AC 126 ms
25,584 KB
testcase_11 AC 124 ms
25,508 KB
testcase_12 AC 116 ms
25,568 KB
testcase_13 AC 122 ms
27,684 KB
testcase_14 AC 127 ms
25,628 KB
testcase_15 AC 124 ms
27,564 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.Numerics;
using static System.Console;
using static System.Math;

class Program
{
    static void Main()
    {
        SetOut(new System.IO.StreamWriter(OpenStandardOutput()) { AutoFlush = false });
        var N = FastIO.Int();
        var X = new int[N];
        var Y = new int[N];
        for (int i = 0; i < X.Length; i++)
        {
            X[i] = FastIO.Int();
        }
        for (int i = 0; i < Y.Length; i++)
        {
            Y[i] = FastIO.Int();
        }

        var m = int.MaxValue;
        for (int i = 0; i < N; i++)
        {
            var d = X[i] + Y[i];
            if (m > d)
            {
                m = d;
            }
        }
        WriteLine(m);
        WriteLine(0);
        for (int i = 0; i < N; i++)
        {
            WriteLine(Min(X[i], m));
        }
        WriteLine(m);
        Out.Flush();
    }
}

public static class FastIO
{
    static System.IO.Stream str = System.Console.OpenStandardInput();
    const int size = 1024;
    static byte[] buffer = new byte[size];
    static int ptr = size;

    static byte Read()
    {
        if (ptr == size)
        {
            str.Read(buffer, 0, size);
            ptr = 0;
        }
        return buffer[ptr++];
    }

    public static int Int()
    {
        var c = Read();
        while (c < 0x21)
        {
            c = Read();
        }
        var n = false;
        if (c == '-')
        {
            n = true;
            c = Read();
        }
        var ret = 0;
        while (c > 0x20)
        {
            ret = ret * 10 + c - '0';
            c = Read();
        }
        return n ? -ret : ret;
    }
}
0