結果
問題 | No.667 Mice's Luck(ネズミ達の運) |
ユーザー |
![]() |
提出日時 | 2018-07-10 23:03:06 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 780 ms / 2,000 ms |
コード長 | 471 bytes |
コンパイル時間 | 787 ms |
コンパイル使用メモリ | 111,964 KB |
実行使用メモリ | 29,996 KB |
最終ジャッジ日時 | 2024-09-14 00:08:00 |
合計ジャッジ時間 | 4,901 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 10 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System; public class Yuki667 { public static void Main() { var s = Console.ReadLine(); var x = CountChar(s, 'x'); var l = s.Length; foreach(char c in s) { if(x == 0) { Console.WriteLine(100.0); continue; } else { Console.WriteLine(((double)(l - x) / l) * 100); if(c == 'x') x -= 1; l -= 1; } } } private static int CountChar(string s, char c) { return s.Length - s.Replace(c.ToString(), "").Length; } }