結果

問題 No.203 ゴールデン・ウィーク(1)
ユーザー takeya_okinotakeya_okino
提出日時 2017-06-25 11:44:20
言語 Java21
(openjdk 21)
結果
AC  
実行時間 111 ms / 1,000 ms
コード長 594 bytes
コンパイル時間 2,062 ms
コンパイル使用メモリ 75,212 KB
実行使用メモリ 41,608 KB
最終ジャッジ日時 2024-04-29 08:23:54
合計ジャッジ時間 5,595 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 94 ms
41,128 KB
testcase_01 AC 103 ms
39,872 KB
testcase_02 AC 91 ms
40,284 KB
testcase_03 AC 92 ms
41,172 KB
testcase_04 AC 94 ms
41,024 KB
testcase_05 AC 97 ms
41,480 KB
testcase_06 AC 98 ms
41,608 KB
testcase_07 AC 97 ms
41,360 KB
testcase_08 AC 96 ms
41,012 KB
testcase_09 AC 106 ms
41,372 KB
testcase_10 AC 110 ms
41,400 KB
testcase_11 AC 107 ms
41,016 KB
testcase_12 AC 95 ms
41,512 KB
testcase_13 AC 95 ms
40,992 KB
testcase_14 AC 111 ms
41,256 KB
testcase_15 AC 108 ms
41,108 KB
testcase_16 AC 108 ms
41,252 KB
testcase_17 AC 107 ms
40,080 KB
testcase_18 AC 104 ms
41,024 KB
testcase_19 AC 105 ms
40,248 KB
testcase_20 AC 97 ms
40,972 KB
testcase_21 AC 96 ms
41,520 KB
testcase_22 AC 110 ms
41,076 KB
testcase_23 AC 109 ms
41,384 KB
testcase_24 AC 106 ms
41,000 KB
testcase_25 AC 104 ms
41,292 KB
testcase_26 AC 99 ms
41,244 KB
testcase_27 AC 108 ms
41,352 KB
testcase_28 AC 103 ms
41,584 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String s1 = sc.next();
    String s2 = sc.next();
    int[] holiday = new int[14];
    if(s1.charAt(0) == 'o') holiday[0] = 1;
    for(int i = 1; i < 7; i++) {
      if(s1.charAt(i) == 'o') holiday[i] = holiday[i - 1] + 1;
    }
    for(int i = 0; i < 7; i++) {
      if(s2.charAt(i) == 'o') holiday[i + 7] = holiday[i + 6] + 1;
    }
    int ans = 0;
    for(int i = 0; i < 14; i++) {
      ans = Math.max(ans, holiday[i]);
    }
    System.out.println(ans);
  }
}
0