結果

問題 No.544 Delete 7
ユーザー tentententen
提出日時 2023-02-15 13:23:34
言語 Java21
(openjdk 21)
結果
AC  
実行時間 71 ms / 1,000 ms
コード長 1,784 bytes
コンパイル時間 2,574 ms
コンパイル使用メモリ 91,044 KB
実行使用メモリ 51,268 KB
最終ジャッジ日時 2023-09-24 22:42:57
合計ジャッジ時間 9,732 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
50,512 KB
testcase_01 AC 71 ms
50,516 KB
testcase_02 AC 70 ms
50,532 KB
testcase_03 AC 69 ms
51,020 KB
testcase_04 AC 70 ms
50,892 KB
testcase_05 AC 70 ms
50,500 KB
testcase_06 AC 68 ms
50,704 KB
testcase_07 AC 70 ms
50,688 KB
testcase_08 AC 69 ms
50,708 KB
testcase_09 AC 71 ms
50,680 KB
testcase_10 AC 69 ms
50,768 KB
testcase_11 AC 68 ms
50,584 KB
testcase_12 AC 70 ms
50,848 KB
testcase_13 AC 69 ms
51,268 KB
testcase_14 AC 70 ms
50,584 KB
testcase_15 AC 68 ms
50,648 KB
testcase_16 AC 70 ms
50,576 KB
testcase_17 AC 69 ms
50,504 KB
testcase_18 AC 69 ms
51,024 KB
testcase_19 AC 70 ms
50,612 KB
testcase_20 AC 71 ms
50,696 KB
testcase_21 AC 69 ms
50,756 KB
testcase_22 AC 69 ms
50,624 KB
testcase_23 AC 70 ms
48,480 KB
testcase_24 AC 70 ms
50,664 KB
testcase_25 AC 69 ms
51,024 KB
testcase_26 AC 69 ms
50,772 KB
testcase_27 AC 69 ms
50,948 KB
testcase_28 AC 67 ms
50,624 KB
testcase_29 AC 69 ms
50,980 KB
testcase_30 AC 68 ms
50,688 KB
testcase_31 AC 65 ms
50,500 KB
testcase_32 AC 68 ms
50,516 KB
testcase_33 AC 69 ms
50,660 KB
testcase_34 AC 69 ms
50,680 KB
testcase_35 AC 69 ms
50,756 KB
testcase_36 AC 70 ms
50,556 KB
testcase_37 AC 70 ms
50,572 KB
testcase_38 AC 71 ms
50,648 KB
testcase_39 AC 70 ms
50,896 KB
testcase_40 AC 70 ms
50,796 KB
testcase_41 AC 70 ms
50,664 KB
testcase_42 AC 68 ms
50,564 KB
testcase_43 AC 70 ms
50,860 KB
testcase_44 AC 69 ms
50,504 KB
testcase_45 AC 70 ms
50,508 KB
testcase_46 AC 70 ms
50,792 KB
testcase_47 AC 68 ms
50,668 KB
testcase_48 AC 70 ms
50,956 KB
testcase_49 AC 69 ms
50,720 KB
testcase_50 AC 70 ms
50,676 KB
testcase_51 AC 68 ms
50,536 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();
        int n = sc.nextInt();
        char[] number = String.valueOf(n).toCharArray();
        int ans = 0;
        for (int i = 0; i < number.length; i++) {
            ans *= 10;
            if (number[i] == '7') {
                number[i] = '6';
                ans++;
            }
        }
        System.out.print(number);
        System.out.println(" " + ans);
    }
}
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