結果
問題 | No.436 ccw |
ユーザー |
![]() |
提出日時 | 2017-06-28 10:08:24 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 68 ms / 2,000 ms |
コード長 | 462 bytes |
コンパイル時間 | 1,758 ms |
コンパイル使用メモリ | 74,480 KB |
実行使用メモリ | 50,968 KB |
最終ジャッジ日時 | 2024-10-04 14:41:43 |
合計ジャッジ時間 | 4,077 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 24 |
ソースコード
import java.io.BufferedReader; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws Exception{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String s = br.readLine(); int c = 0, w = 0; for(int i = 0; i < s.length(); i++){ if(s.charAt(i) == 'c') c++; else w++; } System.out.println(Math.min(c - 1, w)); } }