結果
| 問題 |
No.436 ccw
|
| コンテスト | |
| ユーザー |
いろどり
|
| 提出日時 | 2017-03-01 18:55:06 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 337 bytes |
| コンパイル時間 | 376 ms |
| コンパイル使用メモリ | 53,672 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-06-12 22:17:32 |
| 合計ジャッジ時間 | 2,016 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 19 RE * 5 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:11:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
11 | scanf("%s", s);
| ~~~~~^~~~~~~~~
ソースコード
// ccw
#include <iostream>
#include <cstdio>
using namespace std;
char s[10005] = {};
int count_c, count_w;
int main() {
int i = 0;
scanf("%s", s);
while(i < 10001) {
if(s[i] == 'c') count_c++;
else if(s[i] == 'w') count_w++;
i++;
}
cout << min(count_c - 1, count_w) << endl;
return 0;
}
いろどり