結果

問題 No.216 FAC
ユーザー NoNo
提出日時 2015-06-07 01:53:11
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 59 ms / 1,000 ms
コード長 1,299 bytes
コンパイル時間 2,313 ms
コンパイル使用メモリ 104,808 KB
実行使用メモリ 23,704 KB
最終ジャッジ日時 2023-08-05 02:49:09
合計ジャッジ時間 4,844 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 56 ms
23,472 KB
testcase_01 AC 58 ms
23,576 KB
testcase_02 AC 59 ms
23,620 KB
testcase_03 AC 58 ms
23,512 KB
testcase_04 AC 58 ms
21,588 KB
testcase_05 AC 59 ms
23,680 KB
testcase_06 AC 57 ms
21,640 KB
testcase_07 AC 57 ms
21,592 KB
testcase_08 AC 58 ms
21,544 KB
testcase_09 AC 58 ms
21,652 KB
testcase_10 AC 58 ms
21,700 KB
testcase_11 AC 58 ms
21,484 KB
testcase_12 AC 58 ms
21,572 KB
testcase_13 AC 56 ms
21,444 KB
testcase_14 AC 56 ms
23,528 KB
testcase_15 AC 56 ms
23,568 KB
testcase_16 AC 56 ms
23,596 KB
testcase_17 AC 56 ms
23,600 KB
testcase_18 AC 57 ms
23,704 KB
testcase_19 AC 57 ms
21,484 KB
testcase_20 AC 56 ms
21,404 KB
testcase_21 AC 56 ms
19,580 KB
testcase_22 AC 56 ms
21,628 KB
testcase_23 AC 56 ms
21,464 KB
testcase_24 AC 57 ms
23,592 KB
testcase_25 AC 56 ms
21,464 KB
testcase_26 AC 55 ms
21,472 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.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] - 1] += a[i];
                }
            }

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