結果
| 問題 |
No.216 FAC
|
| コンテスト | |
| ユーザー |
pirorirori_n712
|
| 提出日時 | 2018-07-12 02:07:27 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 819 bytes |
| コンパイル時間 | 1,076 ms |
| コンパイル使用メモリ | 109,924 KB |
| 実行使用メモリ | 27,752 KB |
| 最終ジャッジ日時 | 2024-09-22 12:08:02 |
| 合計ジャッジ時間 | 2,812 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 WA * 1 |
| other | AC * 19 WA * 5 |
コンパイルメッセージ
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[0]);
}
}
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