結果

問題 No.909 たぴの配置
ユーザー iwkjoseciwkjosec
提出日時 2019-10-21 00:06:24
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 126 ms / 3,000 ms
コード長 2,174 bytes
コンパイル時間 2,086 ms
コンパイル使用メモリ 104,268 KB
実行使用メモリ 27,560 KB
最終ジャッジ日時 2023-09-15 14:49:54
合計ジャッジ時間 6,285 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 47 ms
20,488 KB
testcase_01 AC 48 ms
20,380 KB
testcase_02 AC 47 ms
20,308 KB
testcase_03 AC 48 ms
22,456 KB
testcase_04 AC 47 ms
20,532 KB
testcase_05 AC 116 ms
23,576 KB
testcase_06 AC 118 ms
25,728 KB
testcase_07 AC 114 ms
25,548 KB
testcase_08 AC 125 ms
25,596 KB
testcase_09 AC 126 ms
25,748 KB
testcase_10 AC 121 ms
27,560 KB
testcase_11 AC 121 ms
27,528 KB
testcase_12 AC 111 ms
25,592 KB
testcase_13 AC 115 ms
25,624 KB
testcase_14 AC 120 ms
23,484 KB
testcase_15 AC 120 ms
27,524 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;
    static int len;

    static byte Read()
    {
        if (ptr == len)
        {
            len = str.Read(buffer, 0, size);
            if (len == 0) return 0;
            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;
    }

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