結果

問題 No.544 Delete 7
ユーザー baito_pbaito_p
提出日時 2017-07-14 23:04:03
言語 Java21
(openjdk 21)
結果
AC  
実行時間 54 ms / 1,000 ms
コード長 926 bytes
コンパイル時間 1,866 ms
コンパイル使用メモリ 77,380 KB
実行使用メモリ 37,284 KB
最終ジャッジ日時 2024-05-01 11:56:47
合計ジャッジ時間 5,992 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 47 ms
37,036 KB
testcase_01 AC 47 ms
36,956 KB
testcase_02 AC 47 ms
37,112 KB
testcase_03 AC 44 ms
37,120 KB
testcase_04 AC 49 ms
37,032 KB
testcase_05 AC 47 ms
37,112 KB
testcase_06 AC 46 ms
36,900 KB
testcase_07 AC 49 ms
37,012 KB
testcase_08 AC 47 ms
36,916 KB
testcase_09 AC 47 ms
36,648 KB
testcase_10 AC 46 ms
37,016 KB
testcase_11 AC 45 ms
36,948 KB
testcase_12 AC 45 ms
37,036 KB
testcase_13 AC 46 ms
37,248 KB
testcase_14 AC 48 ms
37,128 KB
testcase_15 AC 46 ms
36,904 KB
testcase_16 AC 46 ms
37,112 KB
testcase_17 AC 45 ms
37,076 KB
testcase_18 AC 45 ms
37,092 KB
testcase_19 AC 46 ms
36,924 KB
testcase_20 AC 47 ms
36,656 KB
testcase_21 AC 45 ms
36,996 KB
testcase_22 AC 47 ms
36,896 KB
testcase_23 AC 46 ms
37,068 KB
testcase_24 AC 46 ms
36,956 KB
testcase_25 AC 48 ms
36,632 KB
testcase_26 AC 46 ms
36,796 KB
testcase_27 AC 46 ms
37,068 KB
testcase_28 AC 47 ms
37,012 KB
testcase_29 AC 47 ms
36,932 KB
testcase_30 AC 49 ms
36,972 KB
testcase_31 AC 46 ms
37,132 KB
testcase_32 AC 48 ms
36,652 KB
testcase_33 AC 48 ms
36,640 KB
testcase_34 AC 49 ms
36,984 KB
testcase_35 AC 47 ms
36,960 KB
testcase_36 AC 46 ms
37,012 KB
testcase_37 AC 48 ms
37,064 KB
testcase_38 AC 45 ms
36,964 KB
testcase_39 AC 46 ms
37,048 KB
testcase_40 AC 47 ms
37,128 KB
testcase_41 AC 47 ms
37,284 KB
testcase_42 AC 45 ms
37,096 KB
testcase_43 AC 49 ms
36,840 KB
testcase_44 AC 46 ms
36,824 KB
testcase_45 AC 48 ms
36,964 KB
testcase_46 AC 46 ms
36,916 KB
testcase_47 AC 46 ms
36,664 KB
testcase_48 AC 49 ms
36,932 KB
testcase_49 AC 48 ms
36,672 KB
testcase_50 AC 54 ms
36,900 KB
testcase_51 AC 49 ms
36,924 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args)throws Exception{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int sum = Integer.parseInt(br.readLine());
		int[] a = new int[10];
		int[] b = new int[10];
		
		for( int i = 0 ; sum > 0 ; i++)
		{
			int temp = sum % 10;
			sum /= 10;
			if(temp == 0)a[ 9 - i ] = 0;
			else if(temp == 8)a[ 9 - i ] = 6;
			else a[ 9 - i ] = temp-1;
			b[9-i]= temp - a[9-i];
			
		}
		boolean fla = false;
		for(int i = 0 ; i < 10 ; i++) {
			if(a[i] == 0) {
				if(fla)System.out.print(0);
			}
			else {
				fla = true;
				System.out.print(a[i]);
			}
		}
		System.out.print(" ");
		fla = false;
		for(int i = 0 ; i < 10 ; i++) {
			if(b[i] == 0) {
				if(fla)System.out.print(0);
			}
			else {
				fla = true;
				System.out.print(b[i]);
			}
		}
		System.out.println("");
	}	
}
0