結果

問題 No.436 ccw
ユーザー Mcpu3Mcpu3
提出日時 2018-09-04 15:51:01
言語 Java21
(openjdk 21)
結果
AC  
実行時間 189 ms / 2,000 ms
コード長 315 bytes
コンパイル時間 2,216 ms
コンパイル使用メモリ 74,572 KB
実行使用メモリ 54,616 KB
最終ジャッジ日時 2024-04-21 14:52:23
合計ジャッジ時間 5,865 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 108 ms
54,108 KB
testcase_01 AC 111 ms
54,092 KB
testcase_02 AC 108 ms
53,936 KB
testcase_03 AC 119 ms
54,056 KB
testcase_04 AC 100 ms
52,688 KB
testcase_05 AC 108 ms
53,904 KB
testcase_06 AC 111 ms
53,828 KB
testcase_07 AC 112 ms
54,140 KB
testcase_08 AC 109 ms
53,864 KB
testcase_09 AC 113 ms
53,976 KB
testcase_10 AC 110 ms
53,936 KB
testcase_11 AC 103 ms
53,548 KB
testcase_12 AC 93 ms
52,820 KB
testcase_13 AC 99 ms
52,696 KB
testcase_14 AC 104 ms
53,208 KB
testcase_15 AC 105 ms
53,476 KB
testcase_16 AC 110 ms
53,340 KB
testcase_17 AC 107 ms
52,808 KB
testcase_18 AC 118 ms
53,456 KB
testcase_19 AC 135 ms
54,044 KB
testcase_20 AC 131 ms
53,984 KB
testcase_21 AC 189 ms
54,428 KB
testcase_22 AC 181 ms
54,616 KB
testcase_23 AC 155 ms
54,396 KB
testcase_24 AC 174 ms
54,368 KB
testcase_25 AC 185 ms
54,432 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

class Main{
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		String s=new String();
		int c=0,w=0,i;
		s=sc.next();
		sc.close();
		for(i=0;i<s.length();++i) {
			if(s.charAt(i)=='c') ++c;
			else ++w;
		}
		System.out.print(--c<w?c:w);
	}
}
0