結果
| 問題 | No.436 ccw |
| コンテスト | |
| ユーザー |
ieneko18
|
| 提出日時 | 2016-10-29 13:27:05 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 503 bytes |
| 記録 | |
| コンパイル時間 | 560 ms |
| コンパイル使用メモリ | 96,880 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-05-18 19:26:47 |
| 合計ジャッジ時間 | 1,657 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 2 |
| other | AC * 15 WA * 9 |
コンパイルメッセージ
main.cpp: In function 'int main()':
main.cpp:20:13: warning: 'w_num' may be used uninitialized [-Wmaybe-uninitialized]
20 | int c_num,w_num;
| ^~~~~
main.cpp:20:7: warning: 'c_num' may be used uninitialized [-Wmaybe-uninitialized]
20 | int c_num,w_num;
| ^~~~~
ソースコード
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <stack>
#include <queue>
#include <set>
#include <cmath>
#include <map>
using namespace std;
#define MOD 1000000007
#define INF 999999999
typedef long long ll;
int tt[180][2];
int main(){
string s;
int c_num,w_num;
cin>>s;
for(int i=0;i<s.size();i++){
if(s[i]=='c')c_num++;
if(s[i]=='w')w_num++;
}
int res=min(c_num-1,w_num);
cout<<res<<endl;
return 0;
}
ieneko18