結果
問題 | No.725 木は明らかに森である |
ユーザー | takayuki |
提出日時 | 2018-08-24 21:40:35 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 602 bytes |
コンパイル時間 | 841 ms |
コンパイル使用メモリ | 104,856 KB |
最終ジャッジ日時 | 2025-01-06 12:32:19 |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 9 |
ソースコード
#include<iostream> #include<vector> #include<stdlib.h> #include<time.h> #include<math.h> #include<string.h> #include<algorithm> #include<queue> #include<map> #include<iomanip> using namespace std; int main(void){ string A; vector<int> B; int k=0; cin>>A; for(int i=0; i<A.length(); i++){ if(A[i]=='t' && A[i+1]=='r' && A[i+2]=='e' && A[i+3]=='e' && A[i+4]=='o' && A[i+5]=='n' && A[i+6]=='e'){ B.push_back(i); i+=6; } } for(int j=0; j<A.length(); j++){ if(k<B.size() && j==B[k]){ std::cout<<"forest"; j+=6; k++; } else std::cout<<A[j]; } return 0; }