よじろめ覚書

私の理解度重視のソースコードです。

ABC121B - Can you solve this?

問題:B - Can you solve this?

#include <iostream>
#include <vector>
using namespace std;

#define REP(i, n) for (int i = 0; i < (n); ++i)

int main(void) {
    int n, m, c;

    cin.tie(0);
    ios::sync_with_stdio(false);
    cin >> n >> m >> c;
    vector<int>a(m), b(m);
    REP(i, m) {
        cin >> b[i];
    }
    int cnt = 0;
    REP(i, n) {
        int sum = 0;
        REP(j, m) {
            cin >> a[j];
            sum += a[j] * b[j];
        }
        if (sum + c > 0) {
            cnt++;
        }
    }

    cout << cnt << "\n";
    return 0;
}