結果

問題 No.216 FAC
ユーザー phsplsphspls
提出日時 2020-03-28 00:47:28
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 66 ms / 1,000 ms
コード長 723 bytes
コンパイル時間 2,376 ms
コンパイル使用メモリ 104,120 KB
実行使用メモリ 23,824 KB
最終ジャッジ日時 2023-08-30 17:09:36
合計ジャッジ時間 5,221 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 66 ms
21,524 KB
testcase_01 AC 62 ms
21,524 KB
testcase_02 AC 63 ms
23,608 KB
testcase_03 AC 63 ms
21,440 KB
testcase_04 AC 63 ms
21,616 KB
testcase_05 AC 63 ms
21,568 KB
testcase_06 AC 64 ms
21,548 KB
testcase_07 AC 65 ms
21,612 KB
testcase_08 AC 65 ms
19,672 KB
testcase_09 AC 66 ms
21,840 KB
testcase_10 AC 65 ms
21,548 KB
testcase_11 AC 64 ms
21,828 KB
testcase_12 AC 64 ms
19,668 KB
testcase_13 AC 65 ms
21,548 KB
testcase_14 AC 65 ms
21,504 KB
testcase_15 AC 64 ms
23,600 KB
testcase_16 AC 63 ms
21,452 KB
testcase_17 AC 61 ms
23,576 KB
testcase_18 AC 63 ms
21,692 KB
testcase_19 AC 63 ms
21,552 KB
testcase_20 AC 63 ms
23,592 KB
testcase_21 AC 62 ms
21,544 KB
testcase_22 AC 63 ms
23,684 KB
testcase_23 AC 63 ms
21,624 KB
testcase_24 AC 63 ms
23,592 KB
testcase_25 AC 63 ms
23,824 KB
testcase_26 AC 63 ms
23,552 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;

public class P0216 {
    public static void Main() {
        var n = int.Parse(Console.ReadLine().Trim());
        var a = Console.ReadLine().Trim().Split(' ').Select(int.Parse).ToList();
        var b = Console.ReadLine().Trim().Split(' ').Select(int.Parse).ToList();
        var dict = new Dictionary<int, int>();
        foreach(var pair in a.Zip(b, (i, j) => new { left = i, right = j })) {
            dict[pair.right] = dict.GetValueOrDefault(pair.right) + pair.left; 
        }
        if(dict.GetValueOrDefault(0) >= dict.Values.Max()) {
            Console.WriteLine("YES");
        } else {
            Console.WriteLine("NO");
        }
    }
}
0