結果

問題 No.203 ゴールデン・ウィーク(1)
ユーザー toto
提出日時 2025-03-27 13:24:22
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 377 bytes
コンパイル時間 184 ms
コンパイル使用メモリ 27,264 KB
実行使用メモリ 7,328 KB
最終ジャッジ日時 2025-03-27 13:24:55
合計ジャッジ時間 1,217 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other WA * 29
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:12:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   12 |                 scanf("%s",str);
      |                 ~~~~~^~~~~~~~~~

ソースコード

diff #

#include <stdio.h>

int main(){
	// 連休のカウント
	int count = 0;
	// 最大の連休を保存
	int ans = 0;
	// 1週間のスケジュール
	char str[7];
	// 2週間分ループ
	for(int i = 0;i < 2;i ++){
		scanf("%s",str);
		// 1日ずつ判別
		for(int i = 0;i < 7;i ++){
			if(str[i] == 'o'){
				count++;
			}
			if(count > ans){
				ans = count;
			}
		}	
	}
}
0