結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 125 ms
41,256 KB
testcase_01 RE -
testcase_02 AC 126 ms
41,400 KB
testcase_03 AC 115 ms
39,908 KB
testcase_04 AC 114 ms
40,332 KB
testcase_05 AC 128 ms
41,328 KB
testcase_06 AC 116 ms
39,932 KB
testcase_07 AC 129 ms
41,336 KB
testcase_08 AC 128 ms
41,108 KB
testcase_09 AC 127 ms
41,248 KB
testcase_10 AC 121 ms
40,360 KB
testcase_11 AC 116 ms
39,956 KB
testcase_12 AC 134 ms
41,560 KB
testcase_13 AC 132 ms
41,408 KB
testcase_14 AC 118 ms
40,200 KB
testcase_15 AC 125 ms
41,040 KB
testcase_16 AC 126 ms
41,108 KB
testcase_17 AC 126 ms
41,180 KB
testcase_18 AC 117 ms
39,848 KB
testcase_19 AC 119 ms
39,932 KB
testcase_20 AC 119 ms
40,320 KB
testcase_21 AC 123 ms
40,740 KB
testcase_22 AC 130 ms
41,360 KB
testcase_23 AC 127 ms
41,420 KB
testcase_24 AC 112 ms
40,136 KB
testcase_25 AC 113 ms
40,424 KB
testcase_26 AC 127 ms
41,408 KB
testcase_27 AC 123 ms
40,832 KB
testcase_28 AC 126 ms
41,132 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);
    }
    Optional<String> maxHoliday = holidayList.stream().max(Comparator.comparingInt(String::length));
    System.out.println(maxHoliday.get().length());
  }
}
0