結果
問題 | No.475 最終日 - Writerの怠慢 |
ユーザー |
|
提出日時 | 2019-04-19 12:36:13 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 2,260 bytes |
コンパイル時間 | 2,630 ms |
コンパイル使用メモリ | 112,824 KB |
実行使用メモリ | 37,344 KB |
最終ジャッジ日時 | 2024-09-22 11:23:07 |
合計ジャッジ時間 | 3,430 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 5 WA * 10 |
コンパイルメッセージ
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 static System.Console; using static System.Math; namespace AtTest.yukicoder { class _475 { static void Main(string[] args) { Method(args); } static void Method(string[] args) { int[] nsw = ReadInts(); int n = nsw[0]; int s = nsw[1]; int w = nsw[2]; int[] prevArray = new int[n - 1]; int[] array = ReadInts(); for(int i = 0; i < n; i++) { if (i < w) prevArray[i] = array[i]; if (i > w) prevArray[i - 1] = array[i]; } prevArray = prevArray.OrderBy(a=>-a).ToArray(); int writerTotal = array[w] + 100 * s; int[] points = new int[n - 1]; for(int i = 0; i < n-1; i++) { points[i] = 50 * s + 500 * s / (8 + 2 * (i + 1)); } double res = 1; int pointI = n - 2; for (int i = 0; i < n - 1; i++) { while (pointI >= 0 && prevArray[i] + points[pointI] <= writerTotal) { pointI--; } pointI++; if (n - 1 - pointI <= i) { WriteLine(0); return; } res *= n - 1 - pointI - i; res /= (i + 1); } WriteLine(res); } private static string Read() { return ReadLine(); } private static char[] ReadChars() { return Array.ConvertAll(Read().Split(), a => a[0]); } private static int ReadInt() { return int.Parse(Read()); } private static long ReadLong() { return long.Parse(Read()); } private static double ReadDouble() { return double.Parse(Read()); } private static int[] ReadInts() { return Array.ConvertAll(Read().Split(), int.Parse); } private static long[] ReadLongs() { return Array.ConvertAll(Read().Split(), long.Parse); } private static double[] ReadDoubles() { return Array.ConvertAll(Read().Split(), double.Parse); } } }