結果
| 問題 |
No.341 沈黙の期間
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-06-15 14:49:56 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 460 bytes |
| コンパイル時間 | 483 ms |
| コンパイル使用メモリ | 63,488 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-06-30 14:48:42 |
| 合計ジャッジ時間 | 1,091 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 11 |
ソースコード
#include <iostream>
#include <string>
#include <string.h>
using namespace std;
int main(int argc, char* argv[])
{
const char *s="…";
int sLen=strlen(s);
string S;
cin>>S;
char *pStr=(char*)S.c_str();
int maxNum=0;
int num=0;
char *p=pStr;
while (*p!='\0'){
if (!memcmp(p,s,sLen)){
num++;
p+=sLen;
}else{
if (maxNum<num){
maxNum=num;
}
num=0;
p++;
}
}
if (maxNum<num){
maxNum=num;
}
cout<<maxNum<<endl;
return 0;
}