結果

問題 No.671 1000000007
ユーザー GrenacheGrenache
提出日時 2018-04-21 17:33:36
言語 Java21
(openjdk 21)
結果
AC  
実行時間 116 ms / 2,000 ms
コード長 735 bytes
コンパイル時間 3,192 ms
コンパイル使用メモリ 73,116 KB
実行使用メモリ 39,572 KB
最終ジャッジ日時 2023-09-09 12:20:51
合計ジャッジ時間 5,428 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 113 ms
39,484 KB
testcase_01 AC 113 ms
39,124 KB
testcase_02 AC 114 ms
38,972 KB
testcase_03 AC 115 ms
39,432 KB
testcase_04 AC 115 ms
39,572 KB
testcase_05 AC 116 ms
39,540 KB
testcase_06 AC 115 ms
39,204 KB
testcase_07 AC 113 ms
39,148 KB
testcase_08 AC 115 ms
39,292 KB
testcase_09 AC 116 ms
39,112 KB
testcase_10 AC 114 ms
39,008 KB
testcase_11 AC 115 ms
39,440 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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


public class Main_yukicoder671 {

	private static Scanner sc;
	private static Printer pr;

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

		int cnt = 0;
		for (char c : n) {
			if (c == '0') {
				cnt++;
			}
		}

		pr.println(Math.abs(cnt - 8));
	}

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

		solve();

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

	static String INPUT = null;

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