Submission #1276271


Source Code Expand

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<ll, ll> P;

#define EACH(i,a) for (auto&& i : a)
#define FOR(i,a,b) for (ll i=(a),__last_##i=(b);i<__last_##i;i++)
#define RFOR(i,a,b) for (ll i=(b)-1,__last_##i=(a);i>=__last_##i;i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define __GET_MACRO3(_1, _2, _3, NAME, ...) NAME
#define rep(...) __GET_MACRO3(__VA_ARGS__, FOR, REP)(__VA_ARGS__)
#define rrep(...) __GET_MACRO3(__VA_ARGS__, RFOR, RREP)(__VA_ARGS__)
#define debug(x) cout<<#x<<": "<<x<<endl
#define pb push_back
#define ALL(a) (a).begin(),(a).end()
#define chmin(x,v) x = min(x, v)
#define chmax(x,v) x = max(x, v)

const ll linf = 1e18;
const int inf = 1e9;
const double eps = 1e-12;
const double pi = acos(-1);

template<typename T>
istream& operator>>(istream& is, vector<T>& vec) {
    EACH(x,vec) is >> x;
    return is;
}
template<typename T>
ostream& operator<<(ostream& os, const vector<T>& vec) {
    REP(i,vec.size()) {
        if (i) os << " ";
        os << vec[i];
    }
    return os;
}
template<typename T>
ostream& operator<<(ostream& os, const vector< vector<T> >& vec) {
    REP(i,vec.size()) {
        if (i) os << endl;
        os << vec[i];
    }
    return os;
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    ll h, w; cin >> h >> w;
    vector<vector<ll>> m(h, vector<ll>(w)); cin >> m;
    rep(i, h) rep(j, w) {
        if ((i == 0) ^ (j == 0 || j == w-1)) {
            m[i][j] = !m[i][j];
        }
    }
    ll ans = 0;
    rep(i, h) {
        ll f = -1;
        rep(j, w) {
            if (m[i][j]) {
                ++ans;
            }
            else {
                f = 1;
            }
        }
        ans += f;
    }
    cout << ans << endl;
}

Submission Info

Submission Time
Task C - チョコレート
User drafear
Language C++14 (GCC 5.4.1)
Score 0
Code Size 1894 Byte
Status WA
Exec Time 2 ms
Memory 384 KB

Judge Result

Set Name All
Score / Max Score 0 / 250
Status
AC × 52
WA × 24
Set Name Test Cases
All 00_min_00.txt, 00_min_01.txt, 00_teuchi_01.txt, 00_teuchi_02.txt, 01_or_12.txt, 01_or_13.txt, 01_or_14.txt, 01_or_15.txt, 01_or_16.txt, 01_or_17.txt, 01_or_18.txt, 01_or_19.txt, 01_or_20.txt, 01_or_21.txt, 01_random_00.txt, 01_random_01.txt, 01_random_02.txt, 01_random_03.txt, 01_random_04.txt, 01_random_05.txt, 01_random_06.txt, 01_random_07.txt, 01_random_08.txt, 01_random_09.txt, 01_random_10.txt, 01_random_11.txt, 01_random_12.txt, 01_random_13.txt, 01_random_14.txt, 01_random_15.txt, 01_random_16.txt, 01_random_17.txt, 01_random_18.txt, 01_random_19.txt, 01_random_20.txt, 01_random_21.txt, 01_random_22.txt, 01_random_23.txt, 01_random_24.txt, 01_random_25.txt, 01_random_26.txt, 01_random_27.txt, 01_random_28.txt, 01_random_29.txt, 01_random_30.txt, 01_random_31.txt, 02_oc_22.txt, 02_oc_23.txt, 02_oc_24.txt, 02_oc_25.txt, 02_oc_26.txt, 02_oc_27.txt, 02_oc_28.txt, 02_oc_29.txt, 02_oc_30.txt, 02_oc_31.txt, 03_random_02.txt, 03_random_03.txt, 03_random_04.txt, 03_random_05.txt, 03_random_06.txt, 03_random_07.txt, 03_random_08.txt, 03_random_09.txt, 03_random_10.txt, 03_random_11.txt, 10_asi_24.txt, 10_random_00.txt, 10_random_01.txt, 10_random_02.txt, 10_random_03.txt, 10_random_04.txt, 10_random_05.txt, 10_random_06.txt, 10_random_07.txt, 10_random_08.txt
Case Name Status Exec Time Memory
00_min_00.txt WA 1 ms 256 KB
00_min_01.txt WA 1 ms 256 KB
00_teuchi_01.txt AC 1 ms 256 KB
00_teuchi_02.txt AC 1 ms 256 KB
01_or_12.txt AC 1 ms 256 KB
01_or_13.txt AC 1 ms 256 KB
01_or_14.txt AC 1 ms 256 KB
01_or_15.txt AC 1 ms 256 KB
01_or_16.txt AC 1 ms 256 KB
01_or_17.txt AC 1 ms 256 KB
01_or_18.txt AC 1 ms 256 KB
01_or_19.txt AC 1 ms 256 KB
01_or_20.txt AC 1 ms 256 KB
01_or_21.txt AC 1 ms 256 KB
01_random_00.txt WA 1 ms 256 KB
01_random_01.txt WA 1 ms 256 KB
01_random_02.txt AC 2 ms 384 KB
01_random_03.txt AC 2 ms 384 KB
01_random_04.txt AC 2 ms 384 KB
01_random_05.txt AC 2 ms 384 KB
01_random_06.txt AC 2 ms 384 KB
01_random_07.txt AC 2 ms 384 KB
01_random_08.txt AC 2 ms 384 KB
01_random_09.txt AC 2 ms 384 KB
01_random_10.txt AC 2 ms 384 KB
01_random_11.txt AC 2 ms 384 KB
01_random_12.txt AC 1 ms 256 KB
01_random_13.txt AC 1 ms 256 KB
01_random_14.txt AC 1 ms 256 KB
01_random_15.txt AC 1 ms 256 KB
01_random_16.txt AC 1 ms 256 KB
01_random_17.txt AC 1 ms 256 KB
01_random_18.txt AC 1 ms 256 KB
01_random_19.txt AC 1 ms 256 KB
01_random_20.txt AC 1 ms 256 KB
01_random_21.txt AC 1 ms 256 KB
01_random_22.txt WA 1 ms 256 KB
01_random_23.txt WA 1 ms 256 KB
01_random_24.txt WA 1 ms 256 KB
01_random_25.txt WA 1 ms 256 KB
01_random_26.txt WA 1 ms 256 KB
01_random_27.txt WA 1 ms 256 KB
01_random_28.txt WA 1 ms 256 KB
01_random_29.txt WA 1 ms 256 KB
01_random_30.txt WA 1 ms 256 KB
01_random_31.txt WA 1 ms 256 KB
02_oc_22.txt WA 1 ms 256 KB
02_oc_23.txt WA 1 ms 256 KB
02_oc_24.txt WA 1 ms 256 KB
02_oc_25.txt WA 1 ms 256 KB
02_oc_26.txt WA 1 ms 256 KB
02_oc_27.txt WA 1 ms 256 KB
02_oc_28.txt WA 1 ms 256 KB
02_oc_29.txt WA 1 ms 256 KB
02_oc_30.txt WA 1 ms 256 KB
02_oc_31.txt WA 1 ms 256 KB
03_random_02.txt AC 2 ms 384 KB
03_random_03.txt AC 2 ms 384 KB
03_random_04.txt AC 2 ms 384 KB
03_random_05.txt AC 2 ms 384 KB
03_random_06.txt AC 2 ms 384 KB
03_random_07.txt AC 2 ms 384 KB
03_random_08.txt AC 2 ms 384 KB
03_random_09.txt AC 2 ms 384 KB
03_random_10.txt AC 2 ms 384 KB
03_random_11.txt AC 2 ms 384 KB
10_asi_24.txt AC 2 ms 384 KB
10_random_00.txt AC 1 ms 256 KB
10_random_01.txt AC 2 ms 384 KB
10_random_02.txt AC 1 ms 256 KB
10_random_03.txt AC 1 ms 256 KB
10_random_04.txt AC 1 ms 256 KB
10_random_05.txt AC 1 ms 256 KB
10_random_06.txt AC 1 ms 256 KB
10_random_07.txt AC 1 ms 256 KB
10_random_08.txt AC 1 ms 256 KB