結果
| 問題 | No.345 最小チワワ問題 |
| ユーザー |
|
| 提出日時 | 2026-11-09 06:40:56 |
| 言語 | C++23 (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
WA
不安定
|
| 実行時間 | - |
| コード長 | 638 bytes |
| 記録 | |
| コンパイル時間 | 2,537 ms |
| コンパイル使用メモリ | 333,624 KB |
| 実行使用メモリ | 9,920 KB |
| 最終ジャッジ日時 | 2026-11-09 06:41:01 |
| 合計ジャッジ時間 | 4,747 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge7_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 14 WA * 17 |
ソースコード
#include <bits/stdc++.h>
using i64 = long long;
using u64 = unsigned long long;
using u32 = unsigned;
using u128 = unsigned __int128;
using i128 = __int128;
void solve() {
std::string s; std::cin >> s;
int N = s.size();
int max = -1;
for(int i = 0; i < N; i ++) {
if(s[i] == 'c') {
int Z = 0;
for(int j = i + 1; j < N; j ++) {
if(s[j] == 'w') Z ++;
if(Z == 2) {
max = std::max(max, j - i + 1);
break;
}
}
}
}
std::cout << max;
}
int main() {
std::ios::sync_with_stdio(false);
std::cin.tie(nullptr);
int T = 1;
//std::cin >> T;
while (T--) {
solve();
}
return 0;
}