結果

問題 No.676 C0nvertPr0b1em
ユーザー kohaku_kohakukohaku_kohaku
提出日時 2019-02-19 17:09:33
言語 Java19
(openjdk 21)
結果
AC  
実行時間 121 ms / 2,000 ms
コード長 663 bytes
コンパイル時間 1,803 ms
コンパイル使用メモリ 71,836 KB
実行使用メモリ 56,400 KB
最終ジャッジ日時 2023-09-05 17:30:13
合計ジャッジ時間 6,604 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 114 ms
55,688 KB
testcase_01 AC 115 ms
56,392 KB
testcase_02 AC 118 ms
56,116 KB
testcase_03 AC 118 ms
56,252 KB
testcase_04 AC 117 ms
56,040 KB
testcase_05 AC 117 ms
56,360 KB
testcase_06 AC 118 ms
56,400 KB
testcase_07 AC 118 ms
56,136 KB
testcase_08 AC 118 ms
56,004 KB
testcase_09 AC 113 ms
54,008 KB
testcase_10 AC 117 ms
55,680 KB
testcase_11 AC 116 ms
56,268 KB
testcase_12 AC 117 ms
55,768 KB
testcase_13 AC 117 ms
55,776 KB
testcase_14 AC 115 ms
55,952 KB
testcase_15 AC 118 ms
55,744 KB
testcase_16 AC 116 ms
55,900 KB
testcase_17 AC 117 ms
55,920 KB
testcase_18 AC 117 ms
55,800 KB
testcase_19 AC 115 ms
56,040 KB
testcase_20 AC 118 ms
55,708 KB
testcase_21 AC 118 ms
56,376 KB
testcase_22 AC 121 ms
56,176 KB
testcase_23 AC 114 ms
56,192 KB
testcase_24 AC 113 ms
55,728 KB
testcase_25 AC 113 ms
53,992 KB
testcase_26 AC 114 ms
56,036 KB
testcase_27 AC 115 ms
56,272 KB
testcase_28 AC 115 ms
55,904 KB
testcase_29 AC 115 ms
55,572 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        String ans = solve(s);
        System.out.println(ans);
    }
    
    static String solve(String s) {
        final char UPPER_I = 'I';
        final char LOWER_L = 'l';
        final char ONE = '1';
        s = s.replace(UPPER_I, ONE);
        s = s.replace(LOWER_L, ONE);
        
        final char UPPER_O = 'O';
        final char LOWER_O = 'o';
        final char ZERO = '0';
        s = s.replace(UPPER_O, ZERO);
        s = s.replace(LOWER_O, ZERO);
        
        return s;
    }
}
0