結果
| 問題 |
No.436 ccw
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-01-26 13:50:27 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
AC
|
| 実行時間 | 24 ms / 2,000 ms |
| コード長 | 1,387 bytes |
| コンパイル時間 | 5,015 ms |
| コンパイル使用メモリ | 112,944 KB |
| 実行使用メモリ | 17,664 KB |
| 最終ジャッジ日時 | 2024-12-23 11:38:23 |
| 合計ジャッジ時間 | 2,705 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 24 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System;
using System.Linq;
using System.Collections.Generic;
class Program
{
static void Main(string[] args)
{
string s = Console.ReadLine();
int count = 0;
int a = 0;
for (int i = 0; i < s.Length; i++)
{
if (a == 0)
{
if (s[i] == 'c')
{
a++;
}
else
{
a = 0;
}
continue;
}
if (a == 1)
{
if (s[i] == 'c')
{
a++;
}
else
{
a = 0;
i--;
}
continue;
}
if (a == 2)
{
if (s[i] == 'w')
{
count = i - 1;
break;
}
else
{
a = 0;
i -= 2;
}
continue; ;
}
}
if (count > 0)
{
int l = s.Length / 2;
if (l <= count)
{
count = s.Length - (count + 1);
}
}
Console.WriteLine(count);
Console.Read();
}
}