結果

問題 No.436 ccw
ユーザー darknightdarknight
提出日時 2016-10-28 22:35:12
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 568 bytes
コンパイル時間 2,180 ms
コンパイル使用メモリ 71,844 KB
実行使用メモリ 56,812 KB
最終ジャッジ日時 2023-08-15 21:05:22
合計ジャッジ時間 7,232 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 105 ms
55,688 KB
testcase_01 AC 104 ms
55,512 KB
testcase_02 AC 103 ms
56,036 KB
testcase_03 AC 107 ms
55,656 KB
testcase_04 AC 106 ms
55,740 KB
testcase_05 WA -
testcase_06 AC 102 ms
55,592 KB
testcase_07 AC 110 ms
55,912 KB
testcase_08 AC 108 ms
55,796 KB
testcase_09 AC 110 ms
55,688 KB
testcase_10 AC 105 ms
56,156 KB
testcase_11 AC 107 ms
55,560 KB
testcase_12 AC 104 ms
55,532 KB
testcase_13 AC 104 ms
55,416 KB
testcase_14 AC 102 ms
55,808 KB
testcase_15 AC 105 ms
55,408 KB
testcase_16 AC 120 ms
55,436 KB
testcase_17 AC 114 ms
55,744 KB
testcase_18 AC 114 ms
55,748 KB
testcase_19 AC 121 ms
56,084 KB
testcase_20 AC 116 ms
56,056 KB
testcase_21 AC 172 ms
56,688 KB
testcase_22 AC 173 ms
56,812 KB
testcase_23 AC 175 ms
56,636 KB
testcase_24 AC 175 ms
56,296 KB
testcase_25 AC 166 ms
56,312 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