結果

問題 No.671 1000000007
ユーザー asahi32942398asahi32942398
提出日時 2018-04-28 14:34:27
言語 Java21
(openjdk 21)
結果
AC  
実行時間 120 ms / 2,000 ms
コード長 449 bytes
コンパイル時間 2,301 ms
コンパイル使用メモリ 71,160 KB
実行使用メモリ 56,044 KB
最終ジャッジ日時 2023-09-10 07:47:25
合計ジャッジ時間 4,672 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 120 ms
55,672 KB
testcase_01 AC 119 ms
56,044 KB
testcase_02 AC 118 ms
55,928 KB
testcase_03 AC 117 ms
55,668 KB
testcase_04 AC 117 ms
53,232 KB
testcase_05 AC 117 ms
55,388 KB
testcase_06 AC 116 ms
55,900 KB
testcase_07 AC 116 ms
55,724 KB
testcase_08 AC 117 ms
55,804 KB
testcase_09 AC 114 ms
55,536 KB
testcase_10 AC 118 ms
55,816 KB
testcase_11 AC 117 ms
55,596 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        char[] carr = s.toCharArray();
        int count = 0;
        int answer;
        for(char c:carr){
            if(c=='0')
            count++;
        }
        if(count<8)
        answer = 8-count;
        else
        answer = count-8;
        System.out.println(answer);
    }
}
0