結果

問題 No.216 FAC
ユーザー Crowea
提出日時 2019-01-25 00:40:43
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 815 bytes
コンパイル時間 793 ms
コンパイル使用メモリ 107,136 KB
実行使用メモリ 19,200 KB
最終ジャッジ日時 2024-09-16 04:44:24
合計ジャッジ時間 2,203 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 3
other WA * 24
権限があれば一括ダウンロードができます
コンパイルメッセージ
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;

class Program
{
    static void Main(string[] args)
    {
        // 入力
        var N = int.Parse(Console.ReadLine());
        var a = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToList();
        var b = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToList();

        // スコア計算
        int    myScore = 0;
        int otherScore = 0;
        for (int i=0; i < N; i++)
        {
            if (b[i] == 0)    myScore += a[i];
            if (b[i] == 1) otherScore += a[i];
        }

        Console.WriteLine("oh->{0} : my->{1} | max->{2} : min->{3}", otherScore, myScore, a.Max(), a.Min());

        // 出力
        Console.WriteLine(( myScore >= otherScore && myScore >= a.Max()) ? "YES" : "NO");
    }
}

0