結果
問題 | No.544 Delete 7 |
ユーザー |
![]() |
提出日時 | 2017-07-14 23:04:03 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 54 ms / 1,000 ms |
コード長 | 926 bytes |
コンパイル時間 | 1,822 ms |
コンパイル使用メモリ | 77,500 KB |
実行使用メモリ | 50,400 KB |
最終ジャッジ日時 | 2024-11-21 16:11:41 |
合計ジャッジ時間 | 6,279 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 48 |
ソースコード
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("");}}