Submission #4460380


Source Code Expand

#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define fore(i,a) for(auto &i:a)
#define all(x) (x).begin(),(x).end()
//#pragma GCC optimize ("-O3")
using namespace std; void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
typedef long long ll; const int inf = INT_MAX / 2; const ll infl = 1LL << 60;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a = b; return 1; } return 0; }
//---------------------------------------------------------------------------------------------------
/*---------------------------------------------------------------------------------------------------
            ∧_∧  
      ∧_∧  (´<_` )  Welcome to My Coding Space!
     ( ´_ゝ`) /  ⌒i     
    /   \    | |     
    /   / ̄ ̄ ̄ ̄/  |  
  __(__ニつ/     _/ .| .|____  
     \/____/ (u ⊃  
---------------------------------------------------------------------------------------------------*/













string S;
//---------------------------------------------------------------------------------------------------
void _main() {
    cin >> S;

    int cnt[2] = { 0, 0 };
    fore(c, S) cnt[c - '0']++;

    int ans = min(cnt[0], cnt[1]) * 2;
    cout << ans << endl;
}

Submission Info

Submission Time
Task C - Unification
User hamayanhamayan
Language C++14 (GCC 5.4.1)
Score 300
Code Size 1543 Byte
Status AC
Exec Time 2 ms
Memory 512 KiB

Judge Result

Set Name All Sample
Score / Max Score 300 / 300 0 / 0
Status
AC × 20
AC × 3
Set Name Test Cases
All corner_1, corner_2, corner_3, corner_4, corner_5, corner_6, min_1, min_2, one_1, one_2, random_1, random_2, random_3, random_4, random_5, sample_01, sample_02, sample_03, zero_1, zero_2
Sample sample_01, sample_02, sample_03
Case Name Status Exec Time Memory
corner_1 AC 2 ms 512 KiB
corner_2 AC 2 ms 512 KiB
corner_3 AC 2 ms 512 KiB
corner_4 AC 2 ms 512 KiB
corner_5 AC 2 ms 512 KiB
corner_6 AC 2 ms 512 KiB
min_1 AC 1 ms 256 KiB
min_2 AC 1 ms 256 KiB
one_1 AC 2 ms 512 KiB
one_2 AC 2 ms 512 KiB
random_1 AC 1 ms 256 KiB
random_2 AC 1 ms 256 KiB
random_3 AC 1 ms 384 KiB
random_4 AC 1 ms 384 KiB
random_5 AC 2 ms 512 KiB
sample_01 AC 1 ms 256 KiB
sample_02 AC 1 ms 256 KiB
sample_03 AC 1 ms 256 KiB
zero_1 AC 2 ms 512 KiB
zero_2 AC 1 ms 512 KiB