結果

問題 No.544 Delete 7
ユーザー GrenacheGrenache
提出日時 2017-07-14 22:31:00
言語 Java19
(openjdk 21)
結果
AC  
実行時間 123 ms / 1,000 ms
コード長 824 bytes
コンパイル時間 3,238 ms
コンパイル使用メモリ 72,416 KB
実行使用メモリ 56,400 KB
最終ジャッジ日時 2023-08-13 21:57:18
合計ジャッジ時間 11,958 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 118 ms
55,816 KB
testcase_01 AC 117 ms
55,764 KB
testcase_02 AC 115 ms
55,956 KB
testcase_03 AC 116 ms
56,016 KB
testcase_04 AC 116 ms
55,500 KB
testcase_05 AC 114 ms
55,688 KB
testcase_06 AC 115 ms
55,772 KB
testcase_07 AC 116 ms
55,504 KB
testcase_08 AC 119 ms
55,972 KB
testcase_09 AC 120 ms
56,160 KB
testcase_10 AC 118 ms
56,152 KB
testcase_11 AC 119 ms
55,876 KB
testcase_12 AC 122 ms
56,140 KB
testcase_13 AC 123 ms
56,040 KB
testcase_14 AC 121 ms
56,028 KB
testcase_15 AC 118 ms
55,948 KB
testcase_16 AC 118 ms
55,916 KB
testcase_17 AC 117 ms
54,076 KB
testcase_18 AC 118 ms
56,012 KB
testcase_19 AC 118 ms
56,072 KB
testcase_20 AC 115 ms
55,688 KB
testcase_21 AC 123 ms
55,708 KB
testcase_22 AC 116 ms
56,300 KB
testcase_23 AC 115 ms
56,400 KB
testcase_24 AC 115 ms
56,156 KB
testcase_25 AC 117 ms
55,764 KB
testcase_26 AC 116 ms
55,524 KB
testcase_27 AC 117 ms
55,804 KB
testcase_28 AC 117 ms
55,792 KB
testcase_29 AC 113 ms
55,696 KB
testcase_30 AC 116 ms
55,920 KB
testcase_31 AC 114 ms
55,772 KB
testcase_32 AC 114 ms
55,840 KB
testcase_33 AC 114 ms
55,660 KB
testcase_34 AC 118 ms
55,840 KB
testcase_35 AC 116 ms
55,684 KB
testcase_36 AC 117 ms
56,128 KB
testcase_37 AC 115 ms
53,988 KB
testcase_38 AC 116 ms
55,688 KB
testcase_39 AC 115 ms
55,692 KB
testcase_40 AC 115 ms
56,036 KB
testcase_41 AC 117 ms
55,688 KB
testcase_42 AC 119 ms
56,172 KB
testcase_43 AC 116 ms
53,932 KB
testcase_44 AC 115 ms
55,676 KB
testcase_45 AC 117 ms
55,620 KB
testcase_46 AC 117 ms
55,700 KB
testcase_47 AC 114 ms
55,640 KB
testcase_48 AC 115 ms
55,988 KB
testcase_49 AC 117 ms
56,112 KB
testcase_50 AC 116 ms
55,976 KB
testcase_51 AC 123 ms
55,800 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.*;
import java.util.*;


public class Main_yukicoder544 {

	private static Scanner sc;
	private static Printer pr;

	private static void solve() {
		char[] n = sc.next().toCharArray();
		int m = n.length;

		char[] a = n.clone();
		char[] b = new char[m];
		Arrays.fill(b, '0');

		for (int i = 0; i < m; i++) {
			if (a[i] == '7') {
				a[i]++;
				b[i] = '1';
			}
		}

		int aa = Integer.parseInt(new String(a));
		int bb = Integer.parseInt(new String(b));

		pr.printf("%d %d\n", aa, -bb);
	}

	// ---------------------------------------------------
	public static void main(String[] args) {
		sc = new Scanner(System.in);
		pr = new Printer(System.out);

		solve();

		pr.close();
		sc.close();
	}

	private static class Printer extends PrintWriter {
		Printer(PrintStream out) {
			super(out);
		}
	}
}
0