結果
問題 | No.725 木は明らかに森である |
ユーザー |
![]() |
提出日時 | 2018-08-24 23:12:39 |
言語 | C++11 (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 974 bytes |
コンパイル時間 | 658 ms |
コンパイル使用メモリ | 73,736 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-23 09:28:25 |
合計ジャッジ時間 | 1,285 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 9 |
ソースコード
#include<cstdio>#include<cstring>#include<vector>#include<queue>#include<stack>#include<algorithm>#include<cmath>#include<climits>#include<string>#include<set>#include<numeric>#include<map>#include<iostream>using namespace std;#define rep(i,n) for(int i = 0;i<((int)(n));i++)#define reg(i,a,b) for(int i = ((int)(a));i<=((int)(b));i++)#define irep(i,n) for(int i = ((int)(n)-1);i>=0;i--)#define ireg(i,a,b) for(int i = ((int)(b));i>=((int)(a));i--)typedef long long ll;typedef pair<ll, ll> mp;ll mod = 1e9+7;ll inf = 1e18;//ACint main(void){string s; // 置換対象の文字列cin>>s;string target = "treeone"; // 検索文字列string replacement = "forest"; // 置換文字列if (!target.empty()) {string::size_type pos = 0;while ((pos = s.find(target, pos)) != std::string::npos) {s.replace(pos, target.length(), replacement);pos += replacement.length();}}cout<<s<<endl;return 0;}// treeone==treeone==