結果

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

0