結果
問題 | No.203 ゴールデン・ウィーク(1) |
ユーザー |
![]() |
提出日時 | 2023-06-08 14:40:54 |
言語 | C (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 646 bytes |
コンパイル時間 | 366 ms |
コンパイル使用メモリ | 29,824 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-12-30 22:54:55 |
合計ジャッジ時間 | 1,754 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 29 |
ソースコード
#include <stdio.h> #include <malloc.h> char str[60000]; int str_len = 0; /// <summary> /// グローバル変数strの中身を入力された文字列で上書きする /// </summary> void ReadString() { char c = getchar(); str_len = 0; while (c != '\n') { str[str_len] = c; c = getchar(); str_len++; } } int main() { int max = 0; int now = 0; char days[14]; ReadString(); for (int i = 0; i < 7; i++) days[i] = str[i]; ReadString(); for (int i = 0; i < 7; i++) days[i + 7] = str[i]; for (int i = 0;i < 14;i++) { if (days[i] == 'o') now++; if (now > max) max = now; if (days[i] == 'x') now=0; } printf("%d\n",max); }