結果

問題 No.203 ゴールデン・ウィーク(1)
ユーザー Yosuke YamaguchiYosuke Yamaguchi
提出日時 2021-01-07 00:23:07
言語 Java21
(openjdk 21)
結果
AC  
実行時間 129 ms / 1,000 ms
コード長 717 bytes
コンパイル時間 3,403 ms
コンパイル使用メモリ 80,928 KB
実行使用メモリ 41,960 KB
最終ジャッジ日時 2024-04-25 03:39:37
合計ジャッジ時間 7,793 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 110 ms
40,416 KB
testcase_01 AC 112 ms
40,232 KB
testcase_02 AC 115 ms
41,448 KB
testcase_03 AC 115 ms
41,700 KB
testcase_04 AC 116 ms
41,228 KB
testcase_05 AC 121 ms
41,500 KB
testcase_06 AC 116 ms
40,248 KB
testcase_07 AC 125 ms
41,660 KB
testcase_08 AC 118 ms
41,228 KB
testcase_09 AC 129 ms
41,680 KB
testcase_10 AC 122 ms
41,388 KB
testcase_11 AC 104 ms
40,216 KB
testcase_12 AC 118 ms
41,412 KB
testcase_13 AC 111 ms
40,832 KB
testcase_14 AC 117 ms
41,640 KB
testcase_15 AC 112 ms
40,044 KB
testcase_16 AC 119 ms
41,460 KB
testcase_17 AC 123 ms
41,576 KB
testcase_18 AC 118 ms
41,260 KB
testcase_19 AC 119 ms
41,676 KB
testcase_20 AC 118 ms
41,420 KB
testcase_21 AC 119 ms
41,184 KB
testcase_22 AC 107 ms
40,004 KB
testcase_23 AC 125 ms
41,960 KB
testcase_24 AC 123 ms
41,092 KB
testcase_25 AC 116 ms
41,696 KB
testcase_26 AC 121 ms
41,344 KB
testcase_27 AC 108 ms
40,528 KB
testcase_28 AC 121 ms
41,204 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"));

    Optional<String> maxHoliday = holidayList.stream().max(Comparator.comparingInt(String::length));
    System.out.println(maxHoliday.orElse("").length());
  }
}
0