結果
| 問題 |
No.341 沈黙の期間
|
| コンテスト | |
| ユーザー |
xuelei
|
| 提出日時 | 2018-07-22 13:36:02 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 3 ms / 5,000 ms |
| コード長 | 341 bytes |
| コンパイル時間 | 530 ms |
| コンパイル使用メモリ | 53,980 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-12-26 05:12:40 |
| 合計ジャッジ時間 | 1,281 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 11 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:7:8: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
7 | scanf("%s",s);
| ~~~~~^~~~~~~~
ソースコード
#include <iostream>
#include <stdio.h>
using namespace std;
int main(){
unsigned char s[800];
scanf("%s",s);
int i=0,cnt=0,max=0;
while(s[i]!=0){
if(s[i]==226 && s[i+1]==128 && s[i+2]==166){
cnt++;
max=(max>cnt?max:cnt);
i+=3;
}else{
cnt=0;
i++;
}
}
cout << max << endl;
return 0;
}
xuelei