結果
問題 | No.346 チワワ数え上げ問題 |
ユーザー |
![]() |
提出日時 | 2017-04-13 13:08:46 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 2,262 bytes |
コンパイル時間 | 798 ms |
コンパイル使用メモリ | 112,196 KB |
実行使用メモリ | 31,500 KB |
最終ジャッジ日時 | 2024-07-18 12:55:12 |
合計ジャッジ時間 | 8,104 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 22 ms
31,500 KB |
testcase_01 | AC | 21 ms
25,100 KB |
testcase_02 | AC | 22 ms
24,936 KB |
testcase_03 | AC | 21 ms
24,708 KB |
testcase_04 | AC | 22 ms
25,100 KB |
testcase_05 | AC | 23 ms
25,072 KB |
testcase_06 | AC | 22 ms
24,836 KB |
testcase_07 | AC | 22 ms
24,972 KB |
testcase_08 | AC | 22 ms
24,972 KB |
testcase_09 | AC | 22 ms
22,836 KB |
testcase_10 | WA | - |
testcase_11 | AC | 176 ms
25,220 KB |
testcase_12 | WA | - |
testcase_13 | AC | 146 ms
25,388 KB |
testcase_14 | AC | 25 ms
22,964 KB |
testcase_15 | WA | - |
testcase_16 | WA | - |
testcase_17 | WA | - |
testcase_18 | WA | - |
testcase_19 | WA | - |
testcase_20 | AC | 25 ms
25,552 KB |
testcase_21 | TLE | - |
testcase_22 | -- | - |
testcase_23 | -- | - |
testcase_24 | -- | - |
testcase_25 | -- | - |
コンパイルメッセージ
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.IO; using System.Linq; public class YukiCoder { public static void Solve() { var S = MyConsole.String(); int ans = 0; int maxLen = S.LastIndexOf( 'w' ) + 1; for (int i = 0 ; i < maxLen ; i++) { if (S[i] == 'c') { int wCnt = 0; for (int j = i + 1 ; j < maxLen ; j++) if (S[j] == 'w') ans += wCnt++; } } MyConsole.wLine( ans.ToString() ); } public static void Main() { MyConsole.Read(); Solve(); MyConsole.Finish(); } } public static class MyConsole { private static List<string> ReadedLine = new List<string>(); private static char[] buf = new char[1024]; private static int i; public static void Read() { string sr = Console.In.ReadToEnd(); ReadedLine = sr.Split( new[] { '\r', '\n' }, StringSplitOptions.RemoveEmptyEntries ).ToList(); InputRowCnt = ReadedLine.Count; Console.SetOut( new StreamWriter( Console.OpenStandardOutput() ) { AutoFlush = false } ); } public static int InputRowCnt = 0; public static string String() { return ( i + 1 > ReadedLine.Count ) ? "" : ReadedLine[i++]; } public static string[] StringSplit() { return ReadedLine[i++].Split( new[] { ' ' } ); } public static int Int() { return int.Parse( ReadedLine[i++] ); } public static int[] IntSplit() { string[] strs = StringSplit(); int[] ret = new int[strs.Length]; for (int i = 0 ; i < strs.Length ; i++) { ret[i] = int.Parse( strs[i] ); } return ret; } public static long Long() { return long.Parse( ReadedLine[i++] ); } public static double Double() { return double.Parse( ReadedLine[i++] ); } public static void Write( string output = null ) { Console.Write( output ); } public static void wLine( string output = null ) { Console.WriteLine( output ); } public static void Finish() { Console.Out.Flush(); } }