結果

問題 No.544 Delete 7
ユーザー baito_pbaito_p
提出日時 2017-07-14 23:04:03
言語 Java21
(openjdk 21)
結果
AC  
実行時間 45 ms / 1,000 ms
コード長 926 bytes
コンパイル時間 2,152 ms
コンパイル使用メモリ 73,640 KB
実行使用メモリ 49,920 KB
最終ジャッジ日時 2023-08-13 22:08:13
合計ジャッジ時間 6,873 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
49,156 KB
testcase_01 AC 41 ms
49,344 KB
testcase_02 AC 41 ms
49,280 KB
testcase_03 AC 41 ms
49,296 KB
testcase_04 AC 42 ms
49,920 KB
testcase_05 AC 41 ms
49,288 KB
testcase_06 AC 43 ms
49,448 KB
testcase_07 AC 42 ms
49,368 KB
testcase_08 AC 41 ms
49,576 KB
testcase_09 AC 41 ms
49,412 KB
testcase_10 AC 40 ms
49,316 KB
testcase_11 AC 41 ms
49,504 KB
testcase_12 AC 41 ms
49,148 KB
testcase_13 AC 41 ms
49,552 KB
testcase_14 AC 43 ms
49,364 KB
testcase_15 AC 44 ms
49,332 KB
testcase_16 AC 41 ms
49,184 KB
testcase_17 AC 41 ms
49,416 KB
testcase_18 AC 43 ms
49,304 KB
testcase_19 AC 40 ms
49,352 KB
testcase_20 AC 42 ms
49,196 KB
testcase_21 AC 41 ms
49,708 KB
testcase_22 AC 44 ms
49,192 KB
testcase_23 AC 43 ms
49,248 KB
testcase_24 AC 43 ms
49,344 KB
testcase_25 AC 42 ms
49,288 KB
testcase_26 AC 41 ms
49,200 KB
testcase_27 AC 42 ms
49,660 KB
testcase_28 AC 41 ms
49,108 KB
testcase_29 AC 41 ms
49,464 KB
testcase_30 AC 42 ms
49,328 KB
testcase_31 AC 41 ms
49,352 KB
testcase_32 AC 40 ms
49,200 KB
testcase_33 AC 41 ms
49,248 KB
testcase_34 AC 41 ms
49,300 KB
testcase_35 AC 40 ms
49,332 KB
testcase_36 AC 41 ms
49,204 KB
testcase_37 AC 41 ms
49,288 KB
testcase_38 AC 41 ms
49,208 KB
testcase_39 AC 41 ms
49,280 KB
testcase_40 AC 41 ms
49,184 KB
testcase_41 AC 40 ms
49,268 KB
testcase_42 AC 42 ms
49,408 KB
testcase_43 AC 43 ms
49,184 KB
testcase_44 AC 44 ms
49,128 KB
testcase_45 AC 45 ms
49,396 KB
testcase_46 AC 42 ms
49,288 KB
testcase_47 AC 41 ms
49,284 KB
testcase_48 AC 43 ms
49,292 KB
testcase_49 AC 41 ms
49,292 KB
testcase_50 AC 44 ms
49,816 KB
testcase_51 AC 42 ms
49,372 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