結果
| 問題 |
No.436 ccw
|
| コンテスト | |
| ユーザー |
iroha168
|
| 提出日時 | 2017-01-12 02:20:56 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 612 bytes |
| コンパイル時間 | 790 ms |
| コンパイル使用メモリ | 89,616 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-12-21 10:01:27 |
| 合計ジャッジ時間 | 1,837 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 23 WA * 1 |
ソースコード
#include<string>
#include<iostream>
#include<algorithm>
#include<set>
#include<math.h>
#include<vector>
#include<sstream>
#include<queue>
#include<functional>
#include<bitset>
#include<cstdio>
using namespace std;
int main() {
string a;
cin >> a;
int m = a.length() / 2;
int c = 0, l =0;
for (int i = 0; i < m; i++) {
if (a[i] == 'c' && a[i + 1] == 'c' && a[i+2] == 'w') {
l = i+1;
}
}
c = 0;
int r = 0;
for (int i = a.length() - 3; i >= m; i--) {
if (a[i] == 'c' && a[i + 1] == 'c' && a[i + 2] == 'w') {
r = a.length() - i - 2;
}
}
int mx = max(l, r);
cout << mx << endl;
return 0;
}
iroha168