結果

問題 No.216 FAC
ユーザー しらゆきしらゆき
提出日時 2015-11-20 08:45:33
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 755 bytes
コンパイル時間 2,047 ms
コンパイル使用メモリ 104,300 KB
実行使用メモリ 25,640 KB
最終ジャッジ日時 2023-10-11 18:08:17
合計ジャッジ時間 5,060 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 59 ms
21,544 KB
testcase_01 AC 58 ms
21,596 KB
testcase_02 AC 58 ms
21,664 KB
testcase_03 AC 58 ms
21,584 KB
testcase_04 AC 58 ms
23,680 KB
testcase_05 AC 58 ms
21,536 KB
testcase_06 AC 58 ms
23,676 KB
testcase_07 AC 58 ms
21,632 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 60 ms
21,704 KB
testcase_12 WA -
testcase_13 AC 58 ms
21,780 KB
testcase_14 WA -
testcase_15 AC 58 ms
21,688 KB
testcase_16 AC 59 ms
21,472 KB
testcase_17 AC 59 ms
23,680 KB
testcase_18 WA -
testcase_19 AC 58 ms
21,564 KB
testcase_20 WA -
testcase_21 AC 59 ms
21,480 KB
testcase_22 AC 58 ms
21,724 KB
testcase_23 AC 58 ms
21,552 KB
testcase_24 WA -
testcase_25 AC 58 ms
23,528 KB
testcase_26 AC 58 ms
21,604 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
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()
    {
        int n = int.Parse(Console.ReadLine());
        int[] a = Console.ReadLine().Split().Select(int.Parse).ToArray();
        int[] b = Console.ReadLine().Split().Select(int.Parse).ToArray();

        int score = 0;
        int sum = 0;

        for (int i = 0; i < n; i++)
        {
            if (b[i] == 0) score += a[i];
        }

        for (int i = 1; i <= 100; i++)
        {
            for (int j = 0; j < n; j++)
            {
                if (b[j] == i) sum += a[j];
            }

            if (sum > score)
            {
                Console.WriteLine("NO");
                return;
            }
        }

        Console.WriteLine("YES");
    }
}
0