結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 120 ms
40,720 KB
testcase_01 AC 130 ms
41,032 KB
testcase_02 AC 113 ms
40,064 KB
testcase_03 AC 112 ms
39,968 KB
testcase_04 AC 128 ms
41,172 KB
testcase_05 WA -
testcase_06 AC 123 ms
40,908 KB
testcase_07 AC 127 ms
41,216 KB
testcase_08 AC 124 ms
41,400 KB
testcase_09 AC 128 ms
41,356 KB
testcase_10 AC 123 ms
40,844 KB
testcase_11 AC 131 ms
41,384 KB
testcase_12 AC 130 ms
41,000 KB
testcase_13 AC 125 ms
40,912 KB
testcase_14 AC 124 ms
41,100 KB
testcase_15 AC 127 ms
40,948 KB
testcase_16 AC 128 ms
40,052 KB
testcase_17 AC 130 ms
41,284 KB
testcase_18 AC 145 ms
41,220 KB
testcase_19 AC 137 ms
41,204 KB
testcase_20 AC 137 ms
40,924 KB
testcase_21 AC 200 ms
42,516 KB
testcase_22 AC 193 ms
42,172 KB
testcase_23 AC 186 ms
42,380 KB
testcase_24 AC 189 ms
42,392 KB
testcase_25 AC 185 ms
42,220 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>=q)    System.out.print(q);
        if(q>p)     System.out.print(p-1);
 

              

        System.out.println();
	}
}
0