結果

問題 No.544 Delete 7
ユーザー tetsutetsu
提出日時 2017-11-10 00:48:45
言語 Java21
(openjdk 21)
結果
AC  
実行時間 151 ms / 1,000 ms
コード長 587 bytes
コンパイル時間 3,529 ms
コンパイル使用メモリ 77,088 KB
実行使用メモリ 57,172 KB
最終ジャッジ日時 2023-08-13 22:38:44
合計ジャッジ時間 14,149 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 149 ms
56,764 KB
testcase_01 AC 148 ms
56,776 KB
testcase_02 AC 149 ms
56,772 KB
testcase_03 AC 148 ms
56,972 KB
testcase_04 AC 148 ms
56,568 KB
testcase_05 AC 147 ms
56,460 KB
testcase_06 AC 149 ms
56,768 KB
testcase_07 AC 147 ms
56,708 KB
testcase_08 AC 147 ms
56,472 KB
testcase_09 AC 147 ms
56,752 KB
testcase_10 AC 148 ms
56,808 KB
testcase_11 AC 148 ms
57,172 KB
testcase_12 AC 146 ms
56,848 KB
testcase_13 AC 147 ms
56,800 KB
testcase_14 AC 148 ms
56,812 KB
testcase_15 AC 150 ms
56,808 KB
testcase_16 AC 149 ms
56,872 KB
testcase_17 AC 149 ms
56,924 KB
testcase_18 AC 149 ms
56,612 KB
testcase_19 AC 151 ms
56,820 KB
testcase_20 AC 149 ms
56,580 KB
testcase_21 AC 147 ms
56,776 KB
testcase_22 AC 148 ms
56,640 KB
testcase_23 AC 148 ms
56,788 KB
testcase_24 AC 148 ms
56,636 KB
testcase_25 AC 148 ms
56,948 KB
testcase_26 AC 147 ms
56,852 KB
testcase_27 AC 146 ms
56,840 KB
testcase_28 AC 147 ms
56,804 KB
testcase_29 AC 147 ms
56,468 KB
testcase_30 AC 148 ms
56,576 KB
testcase_31 AC 150 ms
57,024 KB
testcase_32 AC 149 ms
56,704 KB
testcase_33 AC 148 ms
56,832 KB
testcase_34 AC 148 ms
56,820 KB
testcase_35 AC 148 ms
56,816 KB
testcase_36 AC 148 ms
56,916 KB
testcase_37 AC 148 ms
55,096 KB
testcase_38 AC 146 ms
56,408 KB
testcase_39 AC 148 ms
56,956 KB
testcase_40 AC 150 ms
56,632 KB
testcase_41 AC 149 ms
56,940 KB
testcase_42 AC 150 ms
56,712 KB
testcase_43 AC 149 ms
56,788 KB
testcase_44 AC 147 ms
56,832 KB
testcase_45 AC 147 ms
56,796 KB
testcase_46 AC 147 ms
54,788 KB
testcase_47 AC 147 ms
56,744 KB
testcase_48 AC 148 ms
56,712 KB
testcase_49 AC 147 ms
57,092 KB
testcase_50 AC 148 ms
56,824 KB
testcase_51 AC 147 ms
56,780 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package yukicoder;
import java.util.*;

public class P544 {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int copy = N;
		int ketasuu = 0;
		while(copy!=0) {
			copy /=10;
			ketasuu++;
		}
		copy = N;
		ArrayList<Integer> l = new ArrayList<>();
		for(int i=0; i<ketasuu; i++) {
			if(copy%10==7) {
				l.add(1);
			} else {
				l.add(0);
			}
			copy/=10;
		}
		int A = 0;
		Collections.reverse(l);
		for(int x : l) {
			A*= 10;
			A+=x;
		}
		System.out.println(A + " " + (N-A));
	}

}
0