結果

問題 No.203 ゴールデン・ウィーク(1)
ユーザー hum_op
提出日時 2015-05-08 22:46:33
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 395 bytes
コンパイル時間 247 ms
コンパイル使用メモリ 23,168 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-05 19:05:25
合計ジャッジ時間 975 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 8 WA * 21
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:13:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   13 |                 scanf("%c", &day[i]);
      |                 ~~~~~^~~~~~~~~~~~~~~

ソースコード

diff #

#include <cstdio>

int max(int a, int b){
	return a > b ? a : b;
}


int main(){
	char day[14];
	int count = 0;
	int ans = -1;
	for (int i = 0; i < 14; i++){
		scanf("%c", &day[i]);
	}

	for (int i = 0; i < 14; i++){
		if(day[i] == 'o') count = 1;
		for (int j = i; j < 14; j++){
			if (day[j] == 'o') count++;
			else break;
		}

		ans = max(ans, count);
	}

	printf("%d\n", ans);

	return 0;
}
0