結果

問題 No.203 ゴールデン・ウィーク(1)
ユーザー 184
提出日時 2015-05-08 22:30:12
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 1 ms / 1,000 ms
コード長 390 bytes
コンパイル時間 266 ms
コンパイル使用メモリ 24,832 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-11-18 09:00:43
合計ジャッジ時間 970 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 29
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:9:37: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    9 |         char s1[1000],s2[1000];scanf("%s%s",s1,s2);
      |                                ~~~~~^~~~~~~~~~~~~~

ソースコード

diff #

#include <cstdio>
#include <cstring>
#include <cstdlib>


using namespace std;

int main(){
	char s1[1000],s2[1000];scanf("%s%s",s1,s2);
	strcat(s1,s2);
	int ans=0,len=strlen(s1);
	for(int i=0;i<len;i++){
		if(s1[i]=='o'){
			int cnt=1;
			for(int j=i+1;j<len;j++){
				if(s1[j]!='o')break;
				cnt++;
			}
			i+=cnt-1;
			if(ans<cnt)ans=cnt;
		}
	} 
	printf("%d\n",ans);
	
	
	
	return 0;
}
0