結果

問題 No.216 FAC
ユーザー pirorirori_n712pirorirori_n712
提出日時 2018-07-12 02:09:51
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 34 ms / 1,000 ms
コード長 819 bytes
コンパイル時間 1,514 ms
コンパイル使用メモリ 110,848 KB
実行使用メモリ 25,560 KB
最終ジャッジ日時 2023-10-23 18:20:22
合計ジャッジ時間 2,992 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 32 ms
25,552 KB
testcase_01 AC 31 ms
25,536 KB
testcase_02 AC 31 ms
25,536 KB
testcase_03 AC 32 ms
25,552 KB
testcase_04 AC 32 ms
25,552 KB
testcase_05 AC 32 ms
25,552 KB
testcase_06 AC 32 ms
25,536 KB
testcase_07 AC 32 ms
25,536 KB
testcase_08 AC 32 ms
25,536 KB
testcase_09 AC 33 ms
25,552 KB
testcase_10 AC 32 ms
25,552 KB
testcase_11 AC 31 ms
25,536 KB
testcase_12 AC 31 ms
25,536 KB
testcase_13 AC 33 ms
25,552 KB
testcase_14 AC 33 ms
25,552 KB
testcase_15 AC 31 ms
25,536 KB
testcase_16 AC 32 ms
25,560 KB
testcase_17 AC 32 ms
25,560 KB
testcase_18 AC 32 ms
25,560 KB
testcase_19 AC 34 ms
25,560 KB
testcase_20 AC 32 ms
25,560 KB
testcase_21 AC 33 ms
25,560 KB
testcase_22 AC 34 ms
25,560 KB
testcase_23 AC 33 ms
25,560 KB
testcase_24 AC 34 ms
25,560 KB
testcase_25 AC 34 ms
25,560 KB
testcase_26 AC 33 ms
25,536 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;
using System.Collections.Generic;

class No216{
    static void Main(){
        var c=Int32.Parse(Console.ReadLine());
        var a=Console.ReadLine().Split(' ').Select(x=>Int32.Parse(x)).ToArray();
        var b=Console.ReadLine().Split(' ').Select(x=>Int32.Parse(x)).ToArray();
        var dic=new Dictionary<int,int>();
        for(int i=0;i<c;++i){
            if(dic.ContainsKey(b[i])){
             int j=-1;
             dic.TryGetValue(b[i],out j);
             j+=a[i];
             dic[b[i]]=j;
            }
            else{
            dic.Add(b[i],a[i]);
            }
        }
        int k=0;
        dic.TryGetValue(0,out k);
        var s="YES";
        foreach(var value in dic.Values){
            if(value>k)s="NO";
        }
        Console.WriteLine(s);
    }
}
0