結果
| 問題 |
No.216 FAC
|
| コンテスト | |
| ユーザー |
pirorirori_n712
|
| 提出日時 | 2018-07-12 02:09:51 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
AC
|
| 実行時間 | 31 ms / 1,000 ms |
| コード長 | 819 bytes |
| コンパイル時間 | 905 ms |
| コンパイル使用メモリ | 111,116 KB |
| 実行使用メモリ | 27,496 KB |
| 最終ジャッジ日時 | 2024-09-22 12:09:55 |
| 合計ジャッジ時間 | 2,555 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 24 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
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);
}
}
pirorirori_n712