結果

問題 No.671 1000000007
ユーザー yuasa0000
提出日時 2019-03-25 16:06:27
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 345 bytes
コンパイル時間 583 ms
コンパイル使用メモリ 58,716 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-08 10:00:27
合計ジャッジ時間 1,285 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 9
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include "math.h"
#include <string>
using namespace std;
int main() {
	string N;
	int count0 = 8;
	int count = 0;
	cin >> N;
	for (int i = 0; i < N.size(); i++) {
		if (N[i] == '0') {
			count++;
		}
	}
	if (count <= count0)cout << count0 - count << endl;
	else if (count > count0)cout << count - count0 << endl;
	return 0;
}
0