結果
問題 |
No.725 木は明らかに森である
|
ユーザー |
![]() |
提出日時 | 2018-09-07 20:02:06 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 844 bytes |
コンパイル時間 | 870 ms |
コンパイル使用メモリ | 84,540 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-11-28 22:27:55 |
合計ジャッジ時間 | 1,629 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 6 WA * 3 |
ソースコード
#include<iostream> #include<iomanip> #include<algorithm> #include<cmath> #include<vector> #include<string> #include<bitset> #include<queue> #include<set> #include<map> using namespace std; #define FOR(i,a,b) for (int i=(a);i<(b);++i) #define ROF(i,b,a) for (int i=(b);i>(a);--i) #define REP(i,n) FOR(i,0,n) #define PER(i,n) ROF(i,n-1,-1) typedef int i32; typedef long long int i64; typedef unsigned long long int ui64; typedef float f32; typedef double f64; typedef long double f128; typedef pair<int,int> Pi; constexpr int INF = 1e9 + 7; constexpr int dx[4] = {1,0,-1,0}, dy[4] = {0,1,0,-1}; int main() { string s; cin>>s; int i = 0; while (i+6<s.size()) { if (s.substr(i,i+7)=="treeone") { s.replace(i,7,"forest"); i += 6; } else { i++; } } cout<<s<<endl; }