結果

問題 No.216 FAC
ユーザー funakoshifunakoshi
提出日時 2019-06-27 09:50:38
言語 C#(csc)
(csc 3.9.0)
結果
RE  
実行時間 -
コード長 1,135 bytes
コンパイル時間 3,027 ms
コンパイル使用メモリ 109,232 KB
実行使用メモリ 22,864 KB
最終ジャッジ日時 2023-09-09 14:16:40
合計ジャッジ時間 6,252 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 56 ms
20,676 KB
testcase_01 AC 54 ms
20,724 KB
testcase_02 AC 55 ms
20,768 KB
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 AC 54 ms
20,856 KB
testcase_08 AC 54 ms
22,764 KB
testcase_09 AC 54 ms
18,736 KB
testcase_10 AC 54 ms
20,764 KB
testcase_11 WA -
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 WA -
testcase_17 RE -
testcase_18 AC 55 ms
20,784 KB
testcase_19 RE -
testcase_20 RE -
testcase_21 AC 54 ms
20,692 KB
testcase_22 RE -
testcase_23 WA -
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 yukicoderTest
{
    class Program
    {
        static void Main(string[] args)
        {
            string input = Console.ReadLine();
            string[] input2 = Console.ReadLine().Split(' ');
            string[] input3 = Console.ReadLine().Split(' ');
            int n = int.Parse(input);
            int[] score = new int[n];
            int[] answer = new int[n];
            int[] point = new int[n];
            for(int i=0;i<n;i++)
            {
                score[i] = int.Parse(input2[i]);
                answer[i] = int.Parse(input3[i]);
                point[i] = 0;
            }
            for (int i=0;i<n;i++)
            {
                point[answer[i]] = point[answer[i]] + score[i];
            }
            int max = point[0];
            Array.Reverse(point);
            if(max>=point[0])
            {
                Console.WriteLine("YES");
            }
            else
            {
                Console.WriteLine("NO");
            }
        
        }

    }
}
0