結果
| 問題 |
No.725 木は明らかに森である
|
| コンテスト | |
| ユーザー |
sorag
|
| 提出日時 | 2022-08-06 11:17:45 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 670 bytes |
| コンパイル時間 | 756 ms |
| コンパイル使用メモリ | 73,752 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-09-16 07:33:40 |
| 合計ジャッジ時間 | 1,120 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 3 WA * 6 |
コンパイルメッセージ
main.cpp: In function 'int main()':
main.cpp:27:44: warning: converting to non-pointer type '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} from NULL [-Wconversion-null]
27 | s[i + 6] = NULL;
| ^~~~
ソースコード
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<map>
#define all(x) x.begin(),x.end()
#define pb push_back
#define ll long long
#define P pair<int,int>
#define LP pair<ll,ll>
using namespace std;
int main() {
string s;
cin >> s;
if (s.length() > 6) {
for (int i = 0; i < s.length() - 6; i++) {
if (s[i] == 't' and s[i + 1] == 'r' and s[i + 2] == 'e'
and s[i + 3] == 'e' and s[i + 4] == 'o' and s[i + 5] == 'n'
and s[i + 6] == 'e') {
s[i] = 'f';
s[i + 1] = 'o';
s[i + 2] = 'r';
s[i + 3] = 'e';
s[i + 4] = 's';
s[i + 5] = 't';
s[i + 6] = NULL;
}
}
}
cout << s << endl;
return 0;
}
sorag