結果
問題 | No.436 ccw |
ユーザー |
![]() |
提出日時 | 2016-11-01 19:26:18 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 414 bytes |
コンパイル時間 | 1,164 ms |
コンパイル使用メモリ | 158,768 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-11-25 01:13:47 |
合計ジャッジ時間 | 2,007 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 24 |
ソースコード
#include <bits/stdc++.h> #define REP(i,n) for (int i=0;i<(n);i++) #define FOR(i,a,b) for (int i=(a);i<(b);i++) #define endl '\n' const int INF = (1 << 30); using namespace std; typedef long long int ll; void solve(){ string s; cin >> s; auto c = s.find('w'); auto w = s.length() - c; cout << min(c-1, w) << endl; } int main() { cin.tie(0); ios::sync_with_stdio(false); solve(); }