結果
問題 | No.203 ゴールデン・ウィーク(1) |
ユーザー |
![]() |
提出日時 | 2017-08-06 12:45:24 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 682 bytes |
コンパイル時間 | 1,872 ms |
コンパイル使用メモリ | 159,140 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-18 10:14:31 |
合計ジャッジ時間 | 2,271 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 29 |
ソースコード
#include <bits/stdc++.h> #define FOR(i,bg,ed) for(ll i=(bg);i<(ed);i++) #define REP(i,n) FOR(i,0,n) #define MOD 1000000007 #define int long long using namespace std; typedef long long ll; typedef vector<vector<ll>> mat; const int INF = 1e9; signed main() { string C, C2; cin >> C >> C2; C += C2; int dp[20] = {}; int ans = 0; REP(i,C.length()) { if (i == 0) { dp[i] = (C[i] == 'o' ? 1 : 0); ans = max(ans, dp[i]); continue; } if (C[i] == 'o') { dp[i] = dp[i-1] + 1; } else { dp[i] = 0; } ans = max(ans, dp[i]); } cout << ans << endl; }