結果

問題 No.544 Delete 7
ユーザー tentententen
提出日時 2022-08-02 10:26:07
言語 Java21
(openjdk 21)
結果
AC  
実行時間 86 ms / 1,000 ms
コード長 1,290 bytes
コンパイル時間 4,322 ms
コンパイル使用メモリ 79,412 KB
実行使用メモリ 53,172 KB
最終ジャッジ日時 2023-09-30 09:13:33
合計ジャッジ時間 9,640 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
51,148 KB
testcase_01 AC 74 ms
53,028 KB
testcase_02 AC 80 ms
52,380 KB
testcase_03 AC 84 ms
52,996 KB
testcase_04 AC 71 ms
51,264 KB
testcase_05 AC 72 ms
51,068 KB
testcase_06 AC 71 ms
50,884 KB
testcase_07 AC 71 ms
50,848 KB
testcase_08 AC 79 ms
52,376 KB
testcase_09 AC 71 ms
51,156 KB
testcase_10 AC 76 ms
48,912 KB
testcase_11 AC 70 ms
50,484 KB
testcase_12 AC 75 ms
52,320 KB
testcase_13 AC 71 ms
50,832 KB
testcase_14 AC 75 ms
52,484 KB
testcase_15 AC 71 ms
50,576 KB
testcase_16 AC 74 ms
52,404 KB
testcase_17 AC 75 ms
52,856 KB
testcase_18 AC 70 ms
51,144 KB
testcase_19 AC 85 ms
52,320 KB
testcase_20 AC 71 ms
51,068 KB
testcase_21 AC 70 ms
50,868 KB
testcase_22 AC 73 ms
52,740 KB
testcase_23 AC 74 ms
51,476 KB
testcase_24 AC 70 ms
50,536 KB
testcase_25 AC 72 ms
51,312 KB
testcase_26 AC 79 ms
52,692 KB
testcase_27 AC 72 ms
52,480 KB
testcase_28 AC 82 ms
52,864 KB
testcase_29 AC 71 ms
50,852 KB
testcase_30 AC 70 ms
50,840 KB
testcase_31 AC 71 ms
51,004 KB
testcase_32 AC 71 ms
52,212 KB
testcase_33 AC 71 ms
50,944 KB
testcase_34 AC 76 ms
52,324 KB
testcase_35 AC 76 ms
52,476 KB
testcase_36 AC 71 ms
50,520 KB
testcase_37 AC 86 ms
52,564 KB
testcase_38 AC 71 ms
50,596 KB
testcase_39 AC 77 ms
52,576 KB
testcase_40 AC 74 ms
52,384 KB
testcase_41 AC 80 ms
52,144 KB
testcase_42 AC 77 ms
52,504 KB
testcase_43 AC 68 ms
53,172 KB
testcase_44 AC 67 ms
50,992 KB
testcase_45 AC 81 ms
52,516 KB
testcase_46 AC 75 ms
52,656 KB
testcase_47 AC 81 ms
52,848 KB
testcase_48 AC 75 ms
52,396 KB
testcase_49 AC 83 ms
52,388 KB
testcase_50 AC 75 ms
52,592 KB
testcase_51 AC 73 ms
52,344 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner();
        int n = sc.nextInt();
        int a = 0;
        int b = 0;
        int base = 1;
        while (n > 0) {
            int m = n % 10;
            if (m == 8) {
                a += base * 6;
                b += base * 2;
            } else if (m > 0) {
                a += base * (m - 1);
                b += base;
            }
            n /= 10;
            base *= 10;
        }
        System.out.println(a + " " + b);
    }
}

class Scanner {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    StringTokenizer st = new StringTokenizer("");
    
    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 String next() throws Exception {
        while (!st.hasMoreTokens()) {
            st = new StringTokenizer(br.readLine());
        }
        return st.nextToken();
    }
}
0