結果

問題 No.909 たぴの配置
ユーザー bluemeganebluemegane
提出日時 2021-10-08 07:39:43
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 256 ms / 3,000 ms
コード長 894 bytes
コンパイル時間 2,567 ms
コンパイル使用メモリ 63,264 KB
実行使用メモリ 60,464 KB
最終ジャッジ日時 2023-09-30 09:14:26
合計ジャッジ時間 6,890 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 63 ms
21,480 KB
testcase_01 AC 63 ms
21,608 KB
testcase_02 AC 64 ms
23,500 KB
testcase_03 AC 61 ms
21,388 KB
testcase_04 AC 61 ms
21,588 KB
testcase_05 AC 244 ms
59,684 KB
testcase_06 AC 255 ms
60,464 KB
testcase_07 AC 235 ms
56,520 KB
testcase_08 AC 247 ms
59,280 KB
testcase_09 AC 256 ms
58,468 KB
testcase_10 AC 240 ms
58,332 KB
testcase_11 AC 237 ms
58,232 KB
testcase_12 AC 237 ms
58,800 KB
testcase_13 AC 245 ms
57,848 KB
testcase_14 AC 237 ms
58,440 KB
testcase_15 AC 235 ms
56,248 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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