結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 135 ms
41,244 KB
testcase_01 RE -
testcase_02 AC 126 ms
40,320 KB
testcase_03 AC 140 ms
41,704 KB
testcase_04 AC 135 ms
41,044 KB
testcase_05 AC 141 ms
41,376 KB
testcase_06 AC 140 ms
41,352 KB
testcase_07 AC 136 ms
41,332 KB
testcase_08 AC 137 ms
41,164 KB
testcase_09 AC 124 ms
40,352 KB
testcase_10 AC 138 ms
41,296 KB
testcase_11 AC 139 ms
41,020 KB
testcase_12 AC 141 ms
41,336 KB
testcase_13 AC 137 ms
41,100 KB
testcase_14 AC 150 ms
41,492 KB
testcase_15 AC 140 ms
41,600 KB
testcase_16 AC 139 ms
41,396 KB
testcase_17 AC 139 ms
41,352 KB
testcase_18 AC 136 ms
41,196 KB
testcase_19 AC 124 ms
39,896 KB
testcase_20 AC 137 ms
41,304 KB
testcase_21 AC 137 ms
41,224 KB
testcase_22 AC 141 ms
41,364 KB
testcase_23 AC 138 ms
41,484 KB
testcase_24 AC 137 ms
41,372 KB
testcase_25 AC 135 ms
41,332 KB
testcase_26 AC 124 ms
40,164 KB
testcase_27 AC 138 ms
41,636 KB
testcase_28 AC 138 ms
41,100 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