結果

問題 No.216 FAC
ユーザー NoNo
提出日時 2015-06-07 01:47:03
言語 C#(csc)
(csc 3.9.0)
結果
RE  
実行時間 -
コード長 1,295 bytes
コンパイル時間 2,730 ms
コンパイル使用メモリ 106,292 KB
実行使用メモリ 23,552 KB
最終ジャッジ日時 2023-09-20 19:37:39
合計ジャッジ時間 6,145 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 60 ms
21,560 KB
testcase_01 AC 59 ms
21,432 KB
testcase_02 AC 60 ms
21,492 KB
testcase_03 RE -
testcase_04 AC 61 ms
21,404 KB
testcase_05 RE -
testcase_06 AC 59 ms
21,512 KB
testcase_07 AC 61 ms
21,472 KB
testcase_08 AC 60 ms
21,496 KB
testcase_09 AC 62 ms
23,424 KB
testcase_10 AC 61 ms
21,396 KB
testcase_11 AC 60 ms
21,456 KB
testcase_12 AC 59 ms
23,424 KB
testcase_13 RE -
testcase_14 AC 61 ms
23,552 KB
testcase_15 RE -
testcase_16 AC 60 ms
21,432 KB
testcase_17 RE -
testcase_18 AC 60 ms
21,380 KB
testcase_19 RE -
testcase_20 RE -
testcase_21 AC 60 ms
21,492 KB
testcase_22 RE -
testcase_23 AC 60 ms
21,388 KB
testcase_24 RE -
testcase_25 RE -
testcase_26 RE -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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;
using System.Text;
using System.Threading.Tasks;

namespace yuki
{
    class Program
    {
        static void Main(string[] args)
        {
            int N = int.Parse(Console.ReadLine());

            int[] a = Array.ConvertAll<string,int>(Console.ReadLine().Split(), delegate(string value)
            {
                return int.Parse(value);
            });

            int[] b = Array.ConvertAll<string, int>(Console.ReadLine().Split(), delegate(string value)
            {
                return int.Parse(value);
            });

            int[] p = new int[100];
            for (int i = 0; i < p.Length ; i++)
            {
                p[i] = 0;
            }

            int q = 0;
            //-------------------------------------

            for (int i = 0; i < b.Length; i++)
            {
                if (b[i] == 0)
                {
                    q += a[i];
                }
                else
                {
                    p[b[i]] += a[i];
                }
            }

            if (q >= p.Max())
            {
                Console.WriteLine("YES");
            }
            else
            {
                Console.WriteLine("NO");
            }
        }
    }
}
0