結果

問題 No.436 ccw
ユーザー darknightdarknight
提出日時 2016-10-28 22:37:37
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 626 bytes
コンパイル時間 2,112 ms
コンパイル使用メモリ 74,472 KB
実行使用メモリ 53,920 KB
最終ジャッジ日時 2024-05-03 07:40:44
合計ジャッジ時間 6,838 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 126 ms
41,420 KB
testcase_01 AC 108 ms
39,808 KB
testcase_02 AC 129 ms
41,080 KB
testcase_03 AC 124 ms
41,404 KB
testcase_04 AC 125 ms
41,348 KB
testcase_05 WA -
testcase_06 AC 130 ms
41,336 KB
testcase_07 AC 127 ms
41,252 KB
testcase_08 AC 126 ms
41,104 KB
testcase_09 AC 126 ms
40,992 KB
testcase_10 AC 122 ms
41,036 KB
testcase_11 AC 125 ms
41,212 KB
testcase_12 AC 124 ms
40,988 KB
testcase_13 AC 122 ms
41,448 KB
testcase_14 AC 122 ms
40,944 KB
testcase_15 AC 126 ms
41,320 KB
testcase_16 AC 136 ms
41,260 KB
testcase_17 AC 132 ms
41,712 KB
testcase_18 AC 130 ms
40,584 KB
testcase_19 AC 148 ms
41,712 KB
testcase_20 AC 137 ms
41,604 KB
testcase_21 AC 205 ms
42,392 KB
testcase_22 AC 196 ms
42,052 KB
testcase_23 AC 202 ms
42,152 KB
testcase_24 AC 188 ms
42,608 KB
testcase_25 AC 202 ms
42,280 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
 
public class Main {
	public static void main(String[] args) {
 
		Scanner sc  = new Scanner(System.in);

		int o = 0 ,p = 0,q = 0;
		long a = 0, b = 0, c = 0;
		char ch;
		String str;
		
        String s1 = sc.next();
        char[] c1 = s1.toCharArray();
        
        for(int i = 0; i < s1.length(); i++ ){
             if( c1[i]=='c' ) p++;
            if( c1[i]=='w' ) q++;
        
        }
        
        if(p<2 || q < 1) System.out.print("0");
        else if(p>=q)    System.out.print(q);
        else if(q>p)     System.out.print(p-1);
 

              

        System.out.println();
	}
}
0