結果
| 問題 |
No.725 木は明らかに森である
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-08-28 23:55:30 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 671 bytes |
| コンパイル時間 | 432 ms |
| コンパイル使用メモリ | 66,764 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-07-18 11:48:44 |
| 合計ジャッジ時間 | 1,077 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 3 WA * 4 RE * 2 |
ソースコード
#include <iostream>
#include <string>
using namespace std;
string replaceOtherStr(string &replacedStr, string from, string to) {
const unsigned int pos = replacedStr.find(from);
const int len = from.length();
if (pos == std::string::npos || from.empty()) {
return replacedStr;
}
return replacedStr.replace(pos, len, to);
}
int main(){
string s;
cin >> s;
bool flg = 0;
for(int i = 0; i < s.length() - 7; i++){
int u = s.compare(i, 7, "treeone");
if(u == 0){
flg = 1;
break;
}
}
if(flg) replaceOtherStr(s, "treeone", "forest");
cout << s << endl;
return 0;
}