結果

問題 No.544 Delete 7
ユーザー tentententen
提出日時 2023-12-18 13:10:28
言語 Java21
(openjdk 21)
結果
AC  
実行時間 117 ms / 1,000 ms
コード長 1,809 bytes
コンパイル時間 2,789 ms
コンパイル使用メモリ 90,596 KB
実行使用メモリ 56,680 KB
最終ジャッジ日時 2023-12-18 13:10:39
合計ジャッジ時間 10,721 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 87 ms
54,896 KB
testcase_01 AC 89 ms
54,896 KB
testcase_02 AC 100 ms
54,880 KB
testcase_03 AC 88 ms
55,020 KB
testcase_04 AC 90 ms
55,020 KB
testcase_05 AC 90 ms
55,008 KB
testcase_06 AC 89 ms
55,060 KB
testcase_07 AC 86 ms
52,924 KB
testcase_08 AC 89 ms
56,560 KB
testcase_09 AC 117 ms
54,876 KB
testcase_10 AC 89 ms
55,024 KB
testcase_11 AC 88 ms
55,000 KB
testcase_12 AC 86 ms
54,892 KB
testcase_13 AC 90 ms
54,896 KB
testcase_14 AC 90 ms
53,048 KB
testcase_15 AC 88 ms
54,904 KB
testcase_16 AC 88 ms
54,776 KB
testcase_17 AC 87 ms
55,024 KB
testcase_18 AC 87 ms
54,888 KB
testcase_19 AC 106 ms
54,804 KB
testcase_20 AC 87 ms
55,028 KB
testcase_21 AC 89 ms
55,140 KB
testcase_22 AC 86 ms
55,028 KB
testcase_23 AC 83 ms
54,760 KB
testcase_24 AC 85 ms
55,024 KB
testcase_25 AC 88 ms
56,560 KB
testcase_26 AC 86 ms
55,040 KB
testcase_27 AC 88 ms
55,008 KB
testcase_28 AC 87 ms
54,880 KB
testcase_29 AC 98 ms
54,896 KB
testcase_30 AC 103 ms
56,432 KB
testcase_31 AC 87 ms
54,912 KB
testcase_32 AC 87 ms
54,888 KB
testcase_33 AC 89 ms
55,040 KB
testcase_34 AC 87 ms
54,896 KB
testcase_35 AC 88 ms
55,012 KB
testcase_36 AC 87 ms
54,784 KB
testcase_37 AC 87 ms
55,008 KB
testcase_38 AC 89 ms
54,876 KB
testcase_39 AC 88 ms
55,016 KB
testcase_40 AC 92 ms
55,040 KB
testcase_41 AC 88 ms
54,900 KB
testcase_42 AC 90 ms
53,000 KB
testcase_43 AC 87 ms
54,892 KB
testcase_44 AC 100 ms
55,136 KB
testcase_45 AC 93 ms
56,680 KB
testcase_46 AC 94 ms
55,012 KB
testcase_47 AC 90 ms
55,136 KB
testcase_48 AC 88 ms
55,024 KB
testcase_49 AC 87 ms
55,040 KB
testcase_50 AC 91 ms
55,016 KB
testcase_51 AC 91 ms
55,008 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.*;
import java.util.*;
import java.util.stream.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner();
        char[] input = sc.next().toCharArray();
        char[] output = new char[input.length];
        Arrays.fill(output, '0');
        for (int i = 0; i < input.length; i++) {
            if (input[i] == '7') {
                input[i] = '6';
                output[i] = '1';
            }
        }
        System.out.println(new String(input) + " " + Integer.parseInt(new String(output)));
    }
}
class Utilities {
    static String arrayToLineString(Object[] arr) {
        return Arrays.stream(arr).map(x -> x.toString()).collect(Collectors.joining("\n"));
    }
    
    static String arrayToLineString(int[] arr) {
        return String.join("\n", Arrays.stream(arr).mapToObj(String::valueOf).toArray(String[]::new));
    }
}
class Scanner {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    StringTokenizer st = new StringTokenizer("");
    StringBuilder sb = new StringBuilder();
    
    public Scanner() throws Exception {
        
    }
    
    public int nextInt() throws Exception {
        return Integer.parseInt(next());
    }
    
    public long nextLong() throws Exception {
        return Long.parseLong(next());
    }
    
    public double nextDouble() throws Exception {
        return Double.parseDouble(next());
    }
    
    public int[] nextIntArray() throws Exception {
        return Stream.of(br.readLine().split(" ")).mapToInt(Integer::parseInt).toArray();
    }
    
    public String next() throws Exception {
        while (!st.hasMoreTokens()) {
            st = new StringTokenizer(br.readLine());
        }
        return st.nextToken();
    }
    
}
0