結果
問題 | No.345 最小チワワ問題 |
ユーザー | TD |
提出日時 | 2022-06-03 15:04:57 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 709 bytes |
コンパイル時間 | 731 ms |
コンパイル使用メモリ | 106,236 KB |
実行使用メモリ | 24,652 KB |
最終ジャッジ日時 | 2023-10-21 01:28:41 |
合計ジャッジ時間 | 2,722 ms |
ジャッジサーバーID (参考情報) |
judge9 / judge10 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 27 ms
24,648 KB |
testcase_01 | AC | 26 ms
24,648 KB |
testcase_02 | AC | 26 ms
24,648 KB |
testcase_03 | AC | 27 ms
24,648 KB |
testcase_04 | AC | 26 ms
24,648 KB |
testcase_05 | AC | 26 ms
24,648 KB |
testcase_06 | AC | 26 ms
24,648 KB |
testcase_07 | RE | - |
testcase_08 | RE | - |
testcase_09 | RE | - |
testcase_10 | AC | 27 ms
24,648 KB |
testcase_11 | RE | - |
testcase_12 | AC | 27 ms
24,652 KB |
testcase_13 | RE | - |
testcase_14 | AC | 26 ms
24,648 KB |
testcase_15 | AC | 27 ms
24,648 KB |
testcase_16 | WA | - |
testcase_17 | WA | - |
testcase_18 | AC | 26 ms
24,648 KB |
testcase_19 | AC | 27 ms
24,648 KB |
testcase_20 | AC | 26 ms
24,648 KB |
testcase_21 | AC | 27 ms
24,652 KB |
testcase_22 | AC | 27 ms
24,648 KB |
testcase_23 | WA | - |
testcase_24 | WA | - |
testcase_25 | WA | - |
testcase_26 | WA | - |
testcase_27 | WA | - |
testcase_28 | AC | 27 ms
24,652 KB |
testcase_29 | AC | 27 ms
24,648 KB |
testcase_30 | AC | 26 ms
24,648 KB |
testcase_31 | RE | - |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System; namespace yukicoder { class Program { static void Main(string[] args) { string s = Console.ReadLine(); int start = 0; int w; int end = 0; int ans = 0; if( s.IndexOf("cww") != -1) { ans = 3; } else { start = s.IndexOf("c"); w = s.IndexOf("w", start); end = s.IndexOf("w", w+1); if(end!=-1) ans=end-start+1; } if (ans == 0) { ans = -1; } Console.WriteLine(ans); } } }