結果
問題 |
No.725 木は明らかに森である
|
ユーザー |
![]() |
提出日時 | 2018-09-04 19:25:24 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 558 bytes |
コンパイル時間 | 554 ms |
コンパイル使用メモリ | 65,148 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-15 13:48:11 |
合計ジャッジ時間 | 1,376 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 7 WA * 1 RE * 1 |
ソースコード
//inlclude前用define #define _USE_MATH_DEFINES //include #include<iostream> #include<string> #include<algorithm> #include<vector> #include<cmath> using namespace std; //typedef typedef vector<int> VI; typedef vector<string> VS; typedef vector<char> VC; int main() { string s; cin >> s; int size = s.size(); if (size <= 7) { if (s == "treeone") s = "forest"; } else { for (int i = 0; i < (size-7); i++) { string substr = s.substr(i, 7); if (substr == "treeone") { s.replace(i,7,"forest"); } } } cout << s << endl; return 0; }