結果
| 問題 |
No.725 木は明らかに森である
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-09-07 00:54:42 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 622 bytes |
| コンパイル時間 | 583 ms |
| コンパイル使用メモリ | 65,600 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-11-24 13:20:00 |
| 合計ジャッジ時間 | 1,065 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 7 WA * 2 |
ソースコード
#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;
for(int i=0; i<sLen;++i){
if(s[i] == judge[jRecord]){
record = i;
jRecord++;
if(jRecord == 7){
s = s.replace(record-jRecord+1, jRecord, re);
record = -1;
jRecord = 0;
}
}else{
record = -1;
jRecord = 0;
}
}
for(int y=0; y<sLen;++y){
if(s[y] != '#'){
cout << s[y];
}
}
cout << endl;
return 0;
}