結果
| 問題 |
No.725 木は明らかに森である
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-09-07 00:48:04 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 608 bytes |
| コンパイル時間 | 489 ms |
| コンパイル使用メモリ | 66,512 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-11-24 13:13:45 |
| 合計ジャッジ時間 | 946 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 6 WA * 3 |
ソースコード
#include <iostream>
#include <string>
using namespace std;
int main()
{
std::string s;
cin >> s;
int sLen = s.size();
std::string judge = "treeone";
std::string re = "forest";
int record = -1;
int jRecord = 0;
int cLen = sLen;
for(int i=0; i<sLen;++i){
if(i > cLen){ break; }
if(s[i] == judge[jRecord]){
record = i;
jRecord++;
if(jRecord == 7){
s = s.replace(record-jRecord+1, jRecord, re);
cLen--;
record = -1;
jRecord = 0;
}
}else{
record = -1;
jRecord = 0;
}
}
cout << s << "\n";
return 0;
}