結果

問題 No.436 ccw
コンテスト
ユーザー くれちー
提出日時 2016-10-28 22:30:23
言語 C90(gcc12)
(gcc 12.4.0)
コンパイル:
gcc-12 -O2 -std=c90 -DONLINE_JUDGE -o a.out _filename_ -lm
実行:
./a.out
結果
AC  
実行時間 0 ms / 2,000 ms
+ 963µs
コード長 245 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 45 ms
コンパイル使用メモリ 28,416 KB
実行使用メモリ 5,888 KB
最終ジャッジ日時 2026-07-24 15:16:18
合計ジャッジ時間 1,515 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge3_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 24
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <stdio.h>

int main() {
	char s;
	int cntc = 0, cntw = 0;

	while ((s = getchar()) != '\n') {
		if (s == 'c') cntc++;
		else if (s == 'w') cntw++;
	}

	if (cntc <= cntw) printf("%d\n", cntc - 1);
	else printf("%d\n", cntw);
	return 0;
}
0