結果

問題 No.216 FAC
ユーザー Crowea
提出日時 2019-01-25 00:42:34
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 705 bytes
コンパイル時間 867 ms
コンパイル使用メモリ 107,008 KB
実行使用メモリ 19,072 KB
最終ジャッジ日時 2024-09-16 04:44:35
合計ジャッジ時間 2,297 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 22 WA * 2
権限があれば一括ダウンロードができます
コンパイルメッセージ
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(( myScore >= otherScore && myScore >= a.Max()) ? "YES" : "NO");
    }
}

0