結果
問題 |
No.203 ゴールデン・ウィーク(1)
|
ユーザー |
|
提出日時 | 2019-09-04 22:04:59 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 1,000 ms |
コード長 | 583 bytes |
コンパイル時間 | 2,047 ms |
コンパイル使用メモリ | 171,644 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-29 21:04:21 |
合計ジャッジ時間 | 2,815 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 29 |
ソースコード
/** @file 203.cpp @title No.203 ゴールデン・ウィーク(1) - yukicoder @url https://yukicoder.me/problems/no/203 **/ #include <bits/stdc++.h> using namespace std; typedef long long LL; #define ALL(obj) (obj).begin(), (obj).end() #define REP(i, N) for (int i = 0; i < (N); ++i) int main() { string S = ""; string tmp; REP(i, 2) { cin >> tmp; S += tmp; } int N = (int)S.size(); vector<int> dp(N + 1, 0); REP(i, N) { if (S.substr(i, 1) == "o") { dp[i + 1] = dp[i] + 1; } } sort(ALL(dp)); cout << dp[N] << endl; return 0; }