結果
問題 |
No.512 魔法少女の追いかけっこ
|
ユーザー |
![]() |
提出日時 | 2017-05-06 14:51:33 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,043 bytes |
コンパイル時間 | 1,138 ms |
コンパイル使用メモリ | 107,648 KB |
実行使用メモリ | 19,456 KB |
最終ジャッジ日時 | 2024-06-27 06:19:54 |
合計ジャッジ時間 | 3,623 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 49 WA * 4 |
コンパイルメッセージ
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; using System.Collections.Generic; using System.Collections.Specialized; using System.Text; using System.Text.RegularExpressions; using System.IO; using System.Linq; class Program { static void Main() { new Magatro().Solve(); } } class Magatro { private int X, Y; private int N; private decimal[] A; private void Scan() { var line = Console.ReadLine().Split(' '); X = int.Parse(line[0]); Y = int.Parse(line[1]); N = int.Parse(Console.ReadLine()); A = Console.ReadLine().Split(' ').Select(i => int.Parse(i) * 3.6m).ToArray(); } public void Solve() { Scan(); decimal sumX = 0; decimal sumY = A[0]; for (int i = 0; i < N - 1; i++) { sumX += A[i]; sumY += A[i + 1]; if (sumX * Y / X > sumY) { Console.WriteLine("NO"); return; } } Console.WriteLine("YES"); } }