結果

問題 No.1335 1337
ユーザー Yosuke YamaguchiYosuke Yamaguchi
提出日時 2021-01-28 23:24:48
言語 Java21
(openjdk 21)
結果
AC  
実行時間 142 ms / 2,000 ms
コード長 813 bytes
コンパイル時間 3,902 ms
コンパイル使用メモリ 86,020 KB
実行使用メモリ 56,828 KB
最終ジャッジ日時 2023-09-08 14:01:35
合計ジャッジ時間 7,293 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 124 ms
56,096 KB
testcase_01 AC 128 ms
56,124 KB
testcase_02 AC 126 ms
55,472 KB
testcase_03 AC 127 ms
55,840 KB
testcase_04 AC 129 ms
55,744 KB
testcase_05 AC 129 ms
56,176 KB
testcase_06 AC 142 ms
56,828 KB
testcase_07 AC 126 ms
55,820 KB
testcase_08 AC 125 ms
56,320 KB
testcase_09 AC 127 ms
55,984 KB
testcase_10 AC 124 ms
56,116 KB
testcase_11 AC 128 ms
56,088 KB
testcase_12 AC 126 ms
56,236 KB
testcase_13 AC 124 ms
55,780 KB
testcase_14 AC 127 ms
56,156 KB
testcase_15 AC 128 ms
55,820 KB
testcase_16 AC 127 ms
55,872 KB
testcase_17 AC 126 ms
56,420 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Arrays;
import java.util.List;
import java.util.Scanner;
import java.util.stream.Collectors;

// https://yukicoder.me/problems/no/1335
public class Alphabet1337_1335 {
  public static void main(String[] args) {
    // 標準入力から読み込む際に、Scan
    Scanner sc = new Scanner(System.in);

    List<String> alphabetList = Arrays.asList(sc.next().split(""));
    List<String> inputList = Arrays.asList(sc.next().split(""));

    System.out
        .println(inputList.stream().map(s -> replaceNumberToAlphabet(s, alphabetList)).collect(Collectors.joining()));
  }

  private static String replaceNumberToAlphabet(String n, List<String> alphaList) {
    if (n.matches("[+-]?\\d*(\\.\\d+)?")) {
      int i = Integer.parseInt(n);
      return alphaList.get(i);
    }
    return n;
  }
}
0