結果
問題 | No.436 ccw |
ユーザー | togari_takamoto |
提出日時 | 2016-10-28 22:30:30 |
言語 | C++11 (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 817 bytes |
コンパイル時間 | 1,641 ms |
コンパイル使用メモリ | 158,776 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-24 05:47:18 |
合計ジャッジ時間 | 2,970 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 24 |
ソースコード
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; using u32 = uint32_t; using vi = vector<int>; using vvi = vector<vi>; using vb = vector<bool>; using vvb = vector<vb>; using vl = vector<ll>; using vvl = vector<vl>; using vd = vector<double>; using vvd = vector<vd>; #define REP(i,n) for(auto i = 0 * (n), i##_len = (n); i < i##_len; ++i) #define ALL(c) (c).begin(), (c).end() #define FOR(i,s,n) for(ll i=s, i##_len=(ll)(n); i<i##_len; ++i) #define TEN(x) ((ll)1e##x) const ll mod = TEN(9) + 7; int main() { cin.tie(0); ios_base::sync_with_stdio(false); cout << fixed << setprecision(50); string s; cin >> s; REP(i, s.size()) { if (s[i] == 'w') { cout << max<ll>(0, min(i - 1, s.size() - i)) << endl; return 0; } } cout << 0 << endl; return 0; }