結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 113 ms
41,164 KB
testcase_01 RE -
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 108 ms
40,304 KB
testcase_05 WA -
testcase_06 AC 119 ms
41,352 KB
testcase_07 AC 117 ms
41,584 KB
testcase_08 AC 108 ms
40,372 KB
testcase_09 AC 119 ms
41,380 KB
testcase_10 AC 113 ms
41,096 KB
testcase_11 AC 117 ms
41,228 KB
testcase_12 AC 120 ms
40,292 KB
testcase_13 AC 119 ms
41,292 KB
testcase_14 AC 120 ms
40,156 KB
testcase_15 AC 118 ms
41,152 KB
testcase_16 AC 114 ms
41,180 KB
testcase_17 AC 116 ms
41,212 KB
testcase_18 AC 111 ms
40,176 KB
testcase_19 AC 118 ms
41,020 KB
testcase_20 AC 144 ms
40,980 KB
testcase_21 AC 130 ms
40,060 KB
testcase_22 AC 139 ms
41,484 KB
testcase_23 AC 140 ms
41,496 KB
testcase_24 AC 147 ms
41,472 KB
testcase_25 AC 142 ms
41,252 KB
testcase_26 AC 141 ms
41,348 KB
testcase_27 AC 116 ms
41,464 KB
testcase_28 AC 121 ms
41,536 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