結果
| 問題 | No.725 木は明らかに森である |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-08-28 20:46:15 |
| 言語 | C++11(廃止可能性あり) (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 492 bytes |
| 記録 | |
| コンパイル時間 | 624 ms |
| コンパイル使用メモリ | 95,156 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-07-18 03:36:37 |
| 合計ジャッジ時間 | 1,462 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 3 WA * 3 RE * 3 |
ソースコード
#include <iostream>
#include <regex>
#include <string>
std::string replaceOtherStr(std::string &replacedStr, std::string from, std::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(void) {
std::string s;
std::cin >> s;
replaceOtherStr(s, "treeone", "forest");
std::cout << s;
}