結果
| 問題 |
No.341 沈黙の期間
|
| コンテスト | |
| ユーザー |
kongarishisyamo
|
| 提出日時 | 2016-02-24 01:03:32 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 291 bytes |
| コンパイル時間 | 563 ms |
| コンパイル使用メモリ | 55,592 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-09-22 13:15:31 |
| 合計ジャッジ時間 | 1,100 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 3 |
| other | AC * 3 WA * 8 |
コンパイルメッセージ
main.cpp:13:16: warning: multi-character character constant [-Wmultichar]
13 | sample='…';
| ^~~
main.cpp: In function ‘int main()’:
main.cpp:13:16: warning: overflow in conversion from ‘int’ to ‘char’ changes value from ‘14844070’ to ‘'\37777777646'’ [-Woverflow]
ソースコード
#include<iostream>
#include<cstring>
using namespace std;
int main(){
char s;
int ans=0;
int c=0;
char sample;
sample='…';
cin>>s;
while(cin>>s){
if(s=='\n') break;
if(s==sample){
c++;
}
else{
if(c>ans) ans=c;
c=0;
}
}
if(c>ans) ans=c;
cout<<ans<<endl;
}
kongarishisyamo