結果
問題 |
No.216 FAC
|
ユーザー |
|
提出日時 | 2019-01-25 01:48:54 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 40 ms / 1,000 ms |
コード長 | 878 bytes |
コンパイル時間 | 1,251 ms |
コンパイル使用メモリ | 116,748 KB |
実行使用メモリ | 19,584 KB |
最終ジャッジ日時 | 2024-09-16 04:44:41 |
合計ジャッジ時間 | 3,093 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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; class Program { static void Main(string[] args) { // 入力 var N = int.Parse(Console.ReadLine()); var points = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToList(); var solvers = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToList(); if (solvers.Contains(0)) { var results = solvers.Zip(points, (number, score) => new { N = number, S = score }).ToList(); var r2 = results.GroupBy(x => new { x.N }).Select(x => new { N = x.Key.N, S = x.Sum(d => d.S) }).ToList(); var myScore = r2.Where(x => x.N == 0).Max(x => x.S); var max = r2.Max(x => x.S); if (myScore >= max) Console.WriteLine("YES"); else Console.WriteLine("NO"); return; } Console.WriteLine("NO"); } }