結果

問題 No.203 ゴールデン・ウィーク(1)
ユーザー Yosuke YamaguchiYosuke Yamaguchi
提出日時 2021-01-07 00:13:36
言語 Java21
(openjdk 21)
結果
RE  
実行時間 -
コード長 796 bytes
コンパイル時間 3,659 ms
コンパイル使用メモリ 81,672 KB
実行使用メモリ 41,472 KB
最終ジャッジ日時 2024-04-25 03:33:28
合計ジャッジ時間 8,326 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 118 ms
40,096 KB
testcase_01 RE -
testcase_02 AC 123 ms
39,952 KB
testcase_03 AC 129 ms
41,460 KB
testcase_04 AC 119 ms
40,352 KB
testcase_05 AC 138 ms
41,088 KB
testcase_06 AC 124 ms
40,148 KB
testcase_07 AC 117 ms
40,748 KB
testcase_08 AC 125 ms
41,332 KB
testcase_09 AC 119 ms
39,844 KB
testcase_10 AC 132 ms
41,036 KB
testcase_11 AC 133 ms
41,380 KB
testcase_12 AC 126 ms
40,972 KB
testcase_13 AC 128 ms
41,188 KB
testcase_14 AC 116 ms
40,172 KB
testcase_15 AC 126 ms
41,340 KB
testcase_16 AC 130 ms
41,400 KB
testcase_17 AC 130 ms
41,272 KB
testcase_18 AC 128 ms
41,268 KB
testcase_19 AC 125 ms
41,248 KB
testcase_20 AC 120 ms
40,088 KB
testcase_21 AC 127 ms
41,016 KB
testcase_22 AC 126 ms
41,260 KB
testcase_23 AC 120 ms
39,980 KB
testcase_24 AC 131 ms
41,472 KB
testcase_25 AC 120 ms
40,120 KB
testcase_26 AC 113 ms
40,088 KB
testcase_27 AC 127 ms
40,932 KB
testcase_28 AC 132 ms
40,924 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
import java.util.Arrays;
import java.util.Comparator;
import java.util.List;
import java.util.Optional;

// https://yukicoder.me/problems/no/203
public class GW203 {
  public static void main(String[] args) {
    // 標準入力から読み込む際に、Scan
    Scanner sc = new Scanner(System.in);

    // String 1つ分を読み込む
    String firstWeek = sc.next();
    String secondWeek = sc.next();
    String goldenWeek = firstWeek + secondWeek;

    List<String> holidayList = Arrays.asList(goldenWeek.split("x"));
    if (holidayList.size() == 14) {
      System.out.println(0);
      return;
    }
    Optional<String> maxHoliday = holidayList.stream().max(Comparator.comparingInt(String::length));
    System.out.println(maxHoliday.get().length());
  }
}
0