結果

問題 No.203 ゴールデン・ウィーク(1)
ユーザー Yosuke YamaguchiYosuke Yamaguchi
提出日時 2021-01-07 00:08:35
言語 Java21
(openjdk 21)
結果
RE  
実行時間 -
コード長 782 bytes
コンパイル時間 4,575 ms
コンパイル使用メモリ 85,780 KB
実行使用メモリ 41,748 KB
最終ジャッジ日時 2024-04-25 03:29:05
合計ジャッジ時間 9,757 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 140 ms
41,280 KB
testcase_01 RE -
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 139 ms
41,508 KB
testcase_05 WA -
testcase_06 AC 137 ms
41,216 KB
testcase_07 AC 146 ms
41,368 KB
testcase_08 AC 140 ms
41,488 KB
testcase_09 AC 141 ms
41,068 KB
testcase_10 AC 145 ms
41,484 KB
testcase_11 AC 143 ms
41,168 KB
testcase_12 AC 140 ms
41,388 KB
testcase_13 AC 141 ms
41,420 KB
testcase_14 AC 143 ms
41,552 KB
testcase_15 AC 144 ms
41,376 KB
testcase_16 AC 139 ms
41,748 KB
testcase_17 AC 125 ms
39,916 KB
testcase_18 AC 143 ms
41,500 KB
testcase_19 AC 143 ms
41,148 KB
testcase_20 AC 141 ms
41,160 KB
testcase_21 AC 149 ms
41,480 KB
testcase_22 AC 138 ms
41,280 KB
testcase_23 AC 135 ms
41,172 KB
testcase_24 AC 137 ms
41,240 KB
testcase_25 AC 139 ms
41,412 KB
testcase_26 AC 142 ms
41,384 KB
testcase_27 AC 138 ms
41,108 KB
testcase_28 AC 125 ms
39,832 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() == 10) {
      System.out.println(0);
    }
    Optional<String> maxHoliday = holidayList.stream().max(Comparator.comparingInt(String::length));
    System.out.println(maxHoliday.get().length());
  }
}
0