結果

問題 No.909 たぴの配置
コンテスト
ユーザー bluemegane
提出日時 2021-10-08 07:39:43
言語 C#(csc)
(csc 3.9.0)
コンパイル:
csc -langversion:latest -unsafe -warn:0 -o+ /r:System.Numerics.dll _filename_ -out:a.exe
実行:
/usr/bin/mono a.exe
結果
AC  
実行時間 137 ms / 3,000 ms
コード長 894 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 818 ms
コンパイル使用メモリ 111,596 KB
実行使用メモリ 64,784 KB
最終ジャッジ日時 2026-04-03 12:22:16
合計ジャッジ時間 4,674 ms
ジャッジサーバーID
(参考情報)
judge3_1 / judge4_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 13
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #
raw source code

using System.Linq;
using System;

public class Hello
{
    static void Main()
    {
        var n = int.Parse(Console.ReadLine().Trim());
        string[] line = Console.ReadLine().Trim().Split(' ');
        var x = Array.ConvertAll(line, long.Parse);
        line = Console.ReadLine().Trim().Split(' ');
        var y = Array.ConvertAll(line, long.Parse);
        getAns(n, x, y);
    }
    static void getAns(int n, long[] x, long[] y)
    {
        var xy = new long[n];
        for (int i = 0; i < n; i++) xy[i] = x[i] + y[i];
        var xymin = xy.Min();
        var ans = new long[n];
        if (xymin == 0) goto next;
        for (int i = 0; i < n; i++)
        {
            ans[i] = x[i] * xymin / xy[i];
        }
    next:;
        Console.WriteLine(xymin);
        Console.WriteLine(0);
        Console.WriteLine(string.Join("\n", ans));
        Console.WriteLine(xymin);
    }
}
0