結果
問題 | No.346 チワワ数え上げ問題 |
ユーザー |
![]() |
提出日時 | 2016-06-25 13:19:16 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 26 ms / 2,000 ms |
コード長 | 551 bytes |
コンパイル時間 | 2,187 ms |
コンパイル使用メモリ | 111,636 KB |
実行使用メモリ | 25,688 KB |
最終ジャッジ日時 | 2024-10-11 21:35:45 |
合計ジャッジ時間 | 4,087 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 23 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System; namespace No346{ public class Program{ public static void Main(string[] args){ const string cww = "cww"; var str = Console.ReadLine(); var dp = new long[cww.Length + 1]; dp[0] = 1; foreach(var c in str){ for(var i = cww.Length; i > 0; i--) { if(c == cww[i - 1]){ dp[i] += dp[i - 1]; } } } Console.WriteLine(dp[cww.Length]); } } }