結果
問題 | No.725 木は明らかに森である |
ユーザー | takayuki |
提出日時 | 2018-08-24 21:40:35 |
言語 | C++17 (gcc 12.3.0 + boost 1.83.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 602 bytes |
コンパイル時間 | 1,257 ms |
コンパイル使用メモリ | 104,596 KB |
実行使用メモリ | 4,380 KB |
最終ジャッジ日時 | 2023-09-05 11:15:37 |
合計ジャッジ時間 | 1,614 ms |
ジャッジサーバーID (参考情報) |
judge15 / judge13 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 2 ms
4,380 KB |
testcase_01 | AC | 2 ms
4,380 KB |
testcase_02 | AC | 1 ms
4,380 KB |
testcase_03 | AC | 2 ms
4,376 KB |
testcase_04 | AC | 1 ms
4,380 KB |
testcase_05 | AC | 2 ms
4,380 KB |
testcase_06 | AC | 1 ms
4,376 KB |
testcase_07 | AC | 1 ms
4,380 KB |
testcase_08 | AC | 1 ms
4,380 KB |
ソースコード
#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; }