結果

問題 No.544 Delete 7
ユーザー GrenacheGrenache
提出日時 2017-07-14 22:31:00
言語 Java21
(openjdk 21)
結果
AC  
実行時間 143 ms / 1,000 ms
コード長 824 bytes
コンパイル時間 4,020 ms
コンパイル使用メモリ 76,324 KB
実行使用メモリ 41,792 KB
最終ジャッジ日時 2024-05-01 11:49:17
合計ジャッジ時間 12,768 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 137 ms
41,344 KB
testcase_01 AC 136 ms
41,472 KB
testcase_02 AC 139 ms
41,396 KB
testcase_03 AC 142 ms
41,280 KB
testcase_04 AC 138 ms
41,468 KB
testcase_05 AC 137 ms
41,184 KB
testcase_06 AC 136 ms
41,508 KB
testcase_07 AC 139 ms
41,388 KB
testcase_08 AC 139 ms
41,568 KB
testcase_09 AC 136 ms
41,380 KB
testcase_10 AC 137 ms
41,576 KB
testcase_11 AC 137 ms
41,236 KB
testcase_12 AC 136 ms
41,148 KB
testcase_13 AC 137 ms
41,764 KB
testcase_14 AC 136 ms
41,552 KB
testcase_15 AC 138 ms
41,488 KB
testcase_16 AC 140 ms
41,568 KB
testcase_17 AC 136 ms
41,400 KB
testcase_18 AC 135 ms
41,296 KB
testcase_19 AC 134 ms
41,164 KB
testcase_20 AC 138 ms
41,540 KB
testcase_21 AC 135 ms
41,136 KB
testcase_22 AC 142 ms
41,524 KB
testcase_23 AC 135 ms
41,344 KB
testcase_24 AC 120 ms
40,176 KB
testcase_25 AC 139 ms
41,448 KB
testcase_26 AC 137 ms
41,612 KB
testcase_27 AC 136 ms
41,380 KB
testcase_28 AC 139 ms
41,444 KB
testcase_29 AC 137 ms
41,540 KB
testcase_30 AC 137 ms
41,384 KB
testcase_31 AC 143 ms
41,280 KB
testcase_32 AC 131 ms
40,264 KB
testcase_33 AC 134 ms
41,656 KB
testcase_34 AC 139 ms
41,136 KB
testcase_35 AC 137 ms
41,464 KB
testcase_36 AC 137 ms
41,408 KB
testcase_37 AC 137 ms
41,376 KB
testcase_38 AC 120 ms
40,112 KB
testcase_39 AC 135 ms
41,340 KB
testcase_40 AC 136 ms
41,028 KB
testcase_41 AC 135 ms
41,504 KB
testcase_42 AC 134 ms
41,516 KB
testcase_43 AC 136 ms
41,152 KB
testcase_44 AC 137 ms
41,292 KB
testcase_45 AC 136 ms
41,556 KB
testcase_46 AC 136 ms
41,468 KB
testcase_47 AC 138 ms
41,476 KB
testcase_48 AC 138 ms
41,424 KB
testcase_49 AC 138 ms
41,380 KB
testcase_50 AC 140 ms
41,792 KB
testcase_51 AC 137 ms
41,320 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