結果
| 問題 |
No.203 ゴールデン・ウィーク(1)
|
| コンテスト | |
| ユーザー |
toto
|
| 提出日時 | 2025-03-27 13:26:11 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 1,000 ms |
| コード長 | 421 bytes |
| コンパイル時間 | 439 ms |
| コンパイル使用メモリ | 27,904 KB |
| 実行使用メモリ | 7,324 KB |
| 最終ジャッジ日時 | 2025-03-27 13:27:04 |
| 合計ジャッジ時間 | 1,306 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 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);
| ~~~~~^~~~~~~~~~
ソースコード
#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++;
}else{
count = 0;
}
if(count > ans){
ans = count;
}
}
}
printf("%d",ans);
}
toto