結果

問題 No.909 たぴの配置
ユーザー bluemeganebluemegane
提出日時 2021-10-08 07:33:43
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 888 bytes
コンパイル時間 1,951 ms
コンパイル使用メモリ 67,476 KB
実行使用メモリ 60,120 KB
最終ジャッジ日時 2023-09-30 09:14:08
合計ジャッジ時間 9,882 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 62 ms
23,448 KB
testcase_01 AC 61 ms
21,304 KB
testcase_02 AC 61 ms
21,472 KB
testcase_03 AC 60 ms
21,440 KB
testcase_04 WA -
testcase_05 AC 250 ms
56,672 KB
testcase_06 AC 254 ms
57,936 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 243 ms
56,688 KB
testcase_13 AC 248 ms
54,620 KB
testcase_14 WA -
testcase_15 WA -
権限があれば一括ダウンロードができます

ソースコード

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, int.Parse);
        line = Console.ReadLine().Trim().Split(' ');
        var y = Array.ConvertAll(line, int.Parse);
        getAns(n, x, y);
    }
    static void getAns(int n, int[] x, int[] y)
    {
        var xy = new int[n];
        for (int i = 0; i < n; i++) xy[i] = x[i] + y[i];
        var xymin = xy.Min();
        var ans = new int[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