結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 123 ms
41,364 KB
testcase_01 RE -
testcase_02 AC 119 ms
41,124 KB
testcase_03 AC 120 ms
41,568 KB
testcase_04 AC 112 ms
40,068 KB
testcase_05 AC 116 ms
41,484 KB
testcase_06 AC 118 ms
41,144 KB
testcase_07 AC 116 ms
40,444 KB
testcase_08 AC 126 ms
41,108 KB
testcase_09 AC 122 ms
41,464 KB
testcase_10 AC 117 ms
41,328 KB
testcase_11 AC 113 ms
40,412 KB
testcase_12 AC 111 ms
40,420 KB
testcase_13 AC 109 ms
41,208 KB
testcase_14 AC 113 ms
40,804 KB
testcase_15 AC 119 ms
40,864 KB
testcase_16 AC 116 ms
41,304 KB
testcase_17 AC 109 ms
40,524 KB
testcase_18 AC 120 ms
41,520 KB
testcase_19 AC 110 ms
40,376 KB
testcase_20 AC 120 ms
41,120 KB
testcase_21 AC 117 ms
41,424 KB
testcase_22 AC 121 ms
41,236 KB
testcase_23 AC 123 ms
41,412 KB
testcase_24 AC 123 ms
41,536 KB
testcase_25 AC 120 ms
41,388 KB
testcase_26 AC 119 ms
41,160 KB
testcase_27 AC 110 ms
40,408 KB
testcase_28 AC 117 ms
41,388 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