結果
| 問題 |
No.216 FAC
|
| コンテスト | |
| ユーザー |
funakoshi
|
| 提出日時 | 2019-06-27 10:06:13 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 1,226 bytes |
| コンパイル時間 | 808 ms |
| コンパイル使用メモリ | 112,864 KB |
| 実行使用メモリ | 26,076 KB |
| 最終ジャッジ日時 | 2024-06-27 09:19:30 |
| 合計ジャッジ時間 | 2,586 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 9 RE * 15 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
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[input2.Length];
int[] answer = new int[input3.Length];
int[] point = new int[input2.Length];
for(int i=0;i<score.Length;i++)
{
score[i] = int.Parse(input2[i]);
answer[i] = int.Parse(input3[i]);
point[i] = 0;
}
for (int i = 0; i < score.Length; i++)
{
point[answer[i]] = point[answer[i]] + score[i];
}
int max = point[0];
Array.Sort(point);
Array.Reverse(point);
if (max >= point[0])
{
Console.WriteLine("YES");
}
else
{
Console.WriteLine("NO");
}
}
}
}
funakoshi