結果

問題 No.544 Delete 7
ユーザー Shun_PIShun_PI
提出日時 2017-07-14 22:37:58
言語 Java21
(openjdk 21)
結果
AC  
実行時間 81 ms / 1,000 ms
コード長 2,163 bytes
コンパイル時間 2,647 ms
コンパイル使用メモリ 75,260 KB
実行使用メモリ 52,476 KB
最終ジャッジ日時 2023-08-13 22:02:58
合計ジャッジ時間 8,362 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 68 ms
50,608 KB
testcase_01 AC 69 ms
51,436 KB
testcase_02 AC 69 ms
52,312 KB
testcase_03 AC 73 ms
52,076 KB
testcase_04 AC 70 ms
50,860 KB
testcase_05 AC 71 ms
50,508 KB
testcase_06 AC 77 ms
52,448 KB
testcase_07 AC 73 ms
51,860 KB
testcase_08 AC 73 ms
52,476 KB
testcase_09 AC 75 ms
52,028 KB
testcase_10 AC 75 ms
50,700 KB
testcase_11 AC 73 ms
52,296 KB
testcase_12 AC 70 ms
51,000 KB
testcase_13 AC 70 ms
51,860 KB
testcase_14 AC 67 ms
50,312 KB
testcase_15 AC 68 ms
50,512 KB
testcase_16 AC 69 ms
50,416 KB
testcase_17 AC 70 ms
50,536 KB
testcase_18 AC 77 ms
51,812 KB
testcase_19 AC 72 ms
51,752 KB
testcase_20 AC 76 ms
50,528 KB
testcase_21 AC 73 ms
50,480 KB
testcase_22 AC 73 ms
50,392 KB
testcase_23 AC 81 ms
52,404 KB
testcase_24 AC 70 ms
50,516 KB
testcase_25 AC 70 ms
51,680 KB
testcase_26 AC 71 ms
50,816 KB
testcase_27 AC 70 ms
50,676 KB
testcase_28 AC 71 ms
51,016 KB
testcase_29 AC 71 ms
50,512 KB
testcase_30 AC 71 ms
51,524 KB
testcase_31 AC 70 ms
49,280 KB
testcase_32 AC 70 ms
50,424 KB
testcase_33 AC 70 ms
50,296 KB
testcase_34 AC 70 ms
50,344 KB
testcase_35 AC 70 ms
51,720 KB
testcase_36 AC 70 ms
50,496 KB
testcase_37 AC 68 ms
50,272 KB
testcase_38 AC 71 ms
52,452 KB
testcase_39 AC 69 ms
50,992 KB
testcase_40 AC 81 ms
49,828 KB
testcase_41 AC 71 ms
51,996 KB
testcase_42 AC 70 ms
51,788 KB
testcase_43 AC 70 ms
52,172 KB
testcase_44 AC 70 ms
50,348 KB
testcase_45 AC 70 ms
50,260 KB
testcase_46 AC 70 ms
50,228 KB
testcase_47 AC 70 ms
51,432 KB
testcase_48 AC 70 ms
52,388 KB
testcase_49 AC 69 ms
51,248 KB
testcase_50 AC 68 ms
50,884 KB
testcase_51 AC 70 ms
51,792 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.IOException;
import java.io.InputStream;
import java.util.NoSuchElementException;
 
public class Main {
	private static FastScanner sc = new FastScanner();
	
	public static void main(String[] args) {
		int N = sc.nextInt();
		
		int temp = N;
		int digit = 0;
		int A = 0;
		int B = 0;
		while(temp != 0) {
			if(temp%10 == 7) {
				A += 6 * Math.pow(10, digit);
				B += Math.pow(10, digit);
			} else {
				A += (temp%10) * Math.pow(10, digit);
			}
			
			temp /= 10;
			digit++;
		}
		
		System.out.println(A + " " + B);
	}
	
	static class FastScanner {
        private final InputStream in = System.in;
        private final byte[] buffer = new byte[1024];
        private int ptr = 0;
        private int buflen = 0;
        private boolean hasNextByte() {
            if(ptr < buflen) {
                return true;
            } else {
                ptr = 0;
                try {
                    buflen = in.read(buffer);
                } catch(IOException e) {
                    e.printStackTrace();
                }
                if(buflen <= 0) {
                    return false;
                }
            }
            return true;
        }
        private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;}
        private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126;}
        private void skipUnprintable() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++;}
        public boolean hasNext() { skipUnprintable(); return hasNextByte();}
        public String next() {
            if (!hasNext()) throw new NoSuchElementException();
            StringBuilder sb = new StringBuilder();
            int b = readByte();
            while(isPrintableChar(b)) {
                sb.appendCodePoint(b);
                b = readByte();
            }
            return sb.toString();
        }
        public long nextLong() {
            return Long.parseLong(next());
        }
        public int nextInt(){
            return Integer.parseInt(next());
        }
        public double nextDouble(){
            return Double.parseDouble(next());
        }
    }
}
0