prithivMLmods/Coder-Stat huggingface dataset:
Problem p03102 (C++)

Buggy submission (status: Runtime Error):
#include <iostream>
#include <numeric>
#include <vector>
using namespace std;

int main() {
  int n, m, c, ans = 0;
  cin >> n >> m >> c;
  vector<int> b(m);
  vector<vector<int>> a(n, vector<int>(m));
  for (int i = 0; i < m; i++)
    cin >> b[i];
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++)
      cin >> a[i][j];
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++)
      if (inner_product(begin(a[n]), end(a[n]), begin(b), c) > 0)
        ans++;
  cout << ans << endl;
}


Fixed submission:
#include <iostream>
#include <numeric>
#include <vector>
using namespace std;

int main() {
  int n, m, c, ans = 0;
  cin >> n >> m >> c;
  vector<int> b(m);
  vector<vector<int>> a(n, vector<int>(m));
  for (int i = 0; i < m; i++)
    cin >> b[i];
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++)
      cin >> a[i][j];
  for (int i = 0; i < n; i++)
    if (inner_product(begin(a[i]), end(a[i]), begin(b), c) > 0)
      ans++;
  cout << ans << endl;
}
Problem p03102 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;

int main() {
  int N, M, C;
  cin >> N >> M >> C;

  vector<int> B(M);

  int sum = 0;

  for (int i = 0; i < M; i++) {
    cin >> B.at(i);
  }

  int x = 0;

  for (int j = 0; j < N; j++) {
    int sum = 0;
    vector<int> S;

    for (int i = 0; i < M; i++) {

      cin >> S.at(i);
      sum += S.at(i) * B.at(i);

      if (i == M - 1 && sum + C > 0) {

        x++;
      }
    }
  }

  cout << x << endl;
}


Fixed submission:
#include <bits/stdc++.h>
using namespace std;

int main() {
  int N, M, C;
  cin >> N >> M >> C;

  vector<int> B(M);

  int sum = 0;

  for (int i = 0; i < M; i++) {
    cin >> B.at(i);
  }

  int x = 0;

  for (int j = 0; j < N; j++) {
    int sum = 0;
    vector<int> S(M);

    for (int i = 0; i < M; i++) {

      cin >> S.at(i);
      sum += S.at(i) * B.at(i);

      if (i == M - 1 && sum + C > 0) {

        x++;
      }
    }
  }

  cout << x << endl;
}
Problem p03102 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
typedef long long ll;

int main() {
  int N, M;
  int C;
  cin >> N >> M >> C;
  vector<int> B(N);
  rep(i, M) cin >> B[i];
  int ans = 0;
  rep(i, N) {
    ll S = 0;
    rep(j, M) {
      int A;
      cin >> A;
      S += A * B[j];
    }
    S += C;
    if (S > 0)
      ans++;
  }

  cout << ans << endl;

  return 0;
}

Fixed submission:
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
typedef long long ll;

int main() {
  int N, M;
  int C;
  cin >> N >> M >> C;
  vector<int> B(M);
  rep(i, M) cin >> B[i];
  int ans = 0;
  rep(i, N) {
    ll S = 0;
    rep(j, M) {
      int A;
      cin >> A;
      S += A * B[j];
    }
    S += C;
    if (S > 0)
      ans++;
  }

  cout << ans << endl;

  return 0;
}
Problem p03102 (C++)

Buggy submission (status: Runtime Error):
#include <iostream>
#include <vector>

using namespace std;

using Int = long long;

int main() {
  Int N, M, C, ans, count = 0;
  cin >> N >> M >> C;
  vector<Int> B(M);
  for (Int i = 0; i < M; i++) {
    cin >> B[i];
  }
  vector<vector<int>> A(M);
  for (Int i = 0; i < N; i++) {
    A[i].resize(M);
  }
  for (Int i = 0; i < N; i++) {
    for (Int j = 0; j < M; j++) {
      cin >> A[i][j];
    }
  }
  ans = 0;
  for (Int i = 0; i < N; i++) {
    for (Int j = 0; j < M; j++) {
      ans += A[i][j] * B[j];
    }
    if (ans + C > 0)
      count++;
    ans = 0;
  }
  cout << count << endl;
  return 0;
}


Fixed submission:
#include <iostream>
#include <vector>

using namespace std;

using Int = long long;

int main() {
  Int N, M, C, ans, count = 0;
  cin >> N >> M >> C;
  vector<Int> B(M);
  for (Int i = 0; i < M; i++) {
    cin >> B[i];
  }
  vector<vector<int>> A(N);
  for (Int i = 0; i < N; i++) {
    A[i].resize(M);
  }
  for (Int i = 0; i < N; i++) {
    for (Int j = 0; j < M; j++) {
      cin >> A[i][j];
    }
  }
  ans = 0;
  for (Int i = 0; i < N; i++) {
    for (Int j = 0; j < M; j++) {
      ans += A[i][j] * B[j];
    }
    if (ans + C > 0)
      count++;
    ans = 0;
  }
  cout << count << endl;
  return 0;
}
Problem p03102 (C++)

Buggy submission (status: Runtime Error):
#include <iostream>
using namespace std;

int main() {
  long long m, n, c, b[5], a, sum = 0, count = 0;
  cin >> n >> m >> c;
  for (int i = 0; i < m; i++) {
    cin >> b[i];
  }
  for (int i = 0; i < n; i++) {
    sum = 0;
    for (int j = 0; j < m; j++) {
      cin >> a;
      sum += b[j] * a;
    }
    if (sum + c > 0) {
      count++;
    }
  }
  cout << count << '\n';
  return 0;
}


Fixed submission:
#include <iostream>
using namespace std;

int main() {
  int m, n, c, b[100], a, sum = 0, count = 0;
  cin >> n >> m >> c;
  for (int i = 0; i < m; i++) {
    cin >> b[i];
  }
  for (int i = 0; i < n; i++) {
    sum = 0;
    for (int j = 0; j < m; j++) {
      cin >> a;
      sum += b[j] * a;
    }
    if (sum + c > 0) {
      count++;
    }
  }
  cout << count << '\n';
  return 0;
}
Problem p03102 (C++)

Buggy submission (status: Runtime Error):
#include <iostream>
#include <vector>

using namespace std;

int main(void) {
  int n, m, c, ans = 0;
  cin >> n >> m >> c;
  vector<int> b(n);
  for (int i = 0; i < m; i++)
    cin >> b[i];
  for (int i = 0; i < n; i++) {
    int a, sum = 0;
    for (int j = 0; j < m; j++)
      cin >> a, sum += a * b[j];
    ans += (sum + c > 0);
  }
  cout << ans << endl;
}

Fixed submission:
#include <iostream>
#include <vector>

using namespace std;

int main(void) {
  int n, m, c, ans = 0;
  cin >> n >> m >> c;
  vector<int> b(m);
  for (int i = 0; i < m; i++)
    cin >> b[i];
  for (int i = 0; i < n; i++) {
    int a, sum = 0;
    for (int j = 0; j < m; j++)
      cin >> a, sum += a * b[j];
    ans += (sum + c > 0);
  }
  cout << ans << endl;
}
Problem p03102 (C++)

Buggy submission (status: Runtime Error):
#include <algorithm>
#include <functional>
#include <iostream>
#include <map>
#include <math.h>
#include <numeric>
#include <queue>
#include <tuple>
#include <vector>

#define PI 3.14159265359
#define INF 100100100100100100
#define rep(i, n) for (int i = 0; i < n; i++)
#define rep2(i, a, n) for (int i = a; i < n; i++)
#define in(a) cin >> a
#define out(a) cout << a << endl

using namespace std;

typedef long long ll;
typedef pair<ll, ll> PLL;

int main() {
  int ans = 0;
  int n, m, c;
  cin >> n >> m >> c;
  vector<int> b(n);
  rep(i, m) { cin >> b[i]; }

  rep(i, n) {
    ll sum = 0;
    rep(j, m) {
      int a;
      cin >> a;
      sum += a * b[j];
    }
    sum += c;
    if (sum > 0) {
      ans++;
    }
  }

  cout << ans << endl;

  return 0;
}


Fixed submission:
#include <algorithm>
#include <functional>
#include <iostream>
#include <map>
#include <math.h>
#include <numeric>
#include <queue>
#include <tuple>
#include <vector>

#define PI 3.14159265359
#define INF 100100100100100100
#define rep(i, n) for (int i = 0; i < n; i++)
#define rep2(i, a, n) for (int i = a; i < n; i++)
#define in(a) cin >> a
#define out(a) cout << a << endl

using namespace std;

typedef long long ll;
typedef pair<ll, ll> PLL;

int main() {
  int ans = 0;
  int n, m, c;
  cin >> n >> m >> c;
  vector<int> b(m);
  rep(i, m) { cin >> b[i]; }

  rep(i, n) {
    ll sum = 0;
    rep(j, m) {
      int a;
      cin >> a;
      sum += a * b[j];
    }
    sum += c;
    if (sum > 0) {
      ans++;
    }
  }

  cout << ans << endl;

  return 0;
}
Problem p03102 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
#define ll long long
using namespace std;

int main() {
  int n, m, c;
  cin >> n >> m >> c;
  vector<int> v(n);
  for (int i = 0; i < m; i++)
    cin >> v[i];
  int res = 0;
  for (int i = 0; i < n; i++) {
    int sum = 0;
    for (int j = 0; j < m; j++) {
      int a;
      cin >> a;
      sum += a * v[j];
    }
    if (sum + c > 0)
      res++;
  }
  cout << res;
  return 0;
}

Fixed submission:
#include <bits/stdc++.h>
#define ll long long
using namespace std;

int main() {
  int n, m, c;
  cin >> n >> m >> c;
  vector<int> v(m);
  for (int i = 0; i < m; i++)
    cin >> v[i];
  int res = 0;
  for (int i = 0; i < n; i++) {
    int sum = 0;
    for (int j = 0; j < m; j++) {
      int a;
      cin >> a;
      sum += a * v[j];
    }
    if (sum + c > 0)
      res++;
  }
  cout << res;
  return 0;
}
Problem p03102 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
#define MOD (long long)(1E9 + 7)
#define rep(i, n) for (int i = 0; i < n; i++)

using namespace std;

int main() {
  int n, m, c, cnt = 0;
  cin >> n >> m >> c;
  vector<int> b(n);
  rep(i, m) { cin >> b[i]; }
  rep(i, n) {
    int a, t = 0;
    rep(j, m) {
      cin >> a;
      t += a * b[j];
    }
    t += c;
    if (t > 0)
      cnt++;
  }
  cout << cnt << endl;
}

Fixed submission:
#include <bits/stdc++.h>
#define MOD (long long)(1E9 + 7)
#define rep(i, n) for (int i = 0; i < n; i++)

using namespace std;

int main() {
  int n, m, c, cnt = 0;
  cin >> n >> m >> c;
  vector<int> b(m);
  rep(i, m) { cin >> b[i]; }
  rep(i, n) {
    int a, t = 0;
    rep(j, m) {
      cin >> a;
      t += a * b[j];
    }
    t += c;
    if (t > 0)
      cnt++;
  }
  cout << cnt << endl;
}
Problem p03102 (C++)

Buggy submission (status: Runtime Error):
#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <deque>
#include <forward_list>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <utility>
#include <vector>
#define ll long long int
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
int mx4[] = {0, 1, 0, -1};
int my4[] = {1, 0, -1, 0};

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

int main() {
  int n, m, c;
  cin >> n >> m >> c;
  vector<int> b(m);
  int A[m][m];
  rep(i, m) cin >> b[i];

  rep(i, n) {
    rep(j, m) {
      int a;
      cin >> a;
      A[i][j] = a;
    }
  }

  int cnt = 0, check;
  rep(i, n) {
    check = 0;
    rep(j, m) { check += A[i][j] * b[j]; }
    if (check + c > 0)
      cnt++;
  }
  cout << cnt << endl;
}

Fixed submission:
#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <deque>
#include <forward_list>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <utility>
#include <vector>
#define ll long long int
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
int mx4[] = {0, 1, 0, -1};
int my4[] = {1, 0, -1, 0};

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

int main() {
  int n, m, c;
  cin >> n >> m >> c;
  vector<int> b(m);
  int A[n][m];
  rep(i, m) cin >> b[i];

  rep(i, n) {
    rep(j, m) {
      int a;
      cin >> a;
      A[i][j] = a;
    }
  }

  int cnt = 0, check;
  rep(i, n) {
    check = 0;
    rep(j, m) { check += A[i][j] * b[j]; }
    if (check + c > 0)
      cnt++;
  }
  cout << cnt << endl;
}
Problem p03102 (C++)

Buggy submission (status: Memory Limit Exceeded):
#include <algorithm>
#include <iostream>
#include <queue>
#include <vector>
using namespace std;

int main() {
  long long int n, m, c, ans = 0, z;
  cin >> n >> m >> c;
  vector<long long int> b(100000000);
  vector<long long int> a(100000000);

  for (int i = 0; i < m; i++) {
    cin >> b[i];
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      cin >> a[j];
      z += a[j] * b[j];
    }
    z += c;
    if (z > 0) {
      ans++;
    }
    z = 0;
  }

  cout << ans << endl;
  return 0;
}

Fixed submission:
#include <algorithm>
#include <iostream>
#include <queue>
#include <vector>
using namespace std;

int main() {
  long long int n, m, c, ans = 0, z;
  cin >> n >> m >> c;
  vector<long long int> b(1000000);
  vector<long long int> a(1000000);

  for (int i = 0; i < m; i++) {
    cin >> b[i];
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      cin >> a[j];
      z += a[j] * b[j];
    }
    z += c;
    if (z > 0) {
      ans++;
    }
    z = 0;
  }

  cout << ans << endl;
  return 0;
}
Problem p03102 (C++)

Buggy submission (status: Runtime Error):
// #include <bits/stdc++.h>
#include <iostream>
#include <vector>

#define rep(i, n) for (int i = 0; i < (n); ++i)
#define repr(i, n) for (int i = 0; i < (f); --i)
using namespace std;
using ll = long long;
using P = pair<int, int>;

const int MAX = 100;
const int INF = (1 << 12);

int main() {
  int n, m, c;
  cin >> n >> m >> c;

  vector<int> B(n);
  rep(i, m) cin >> B[i];

  int ans = 0;
  rep(i, n) {
    int sum = c;
    rep(j, m) {
      int a;
      cin >> a;
      sum += a * B[j];
    }
    if (sum > 0)
      ans++;
  }
  cout << ans << endl;
  return 0;
}

Fixed submission:
// #include <bits/stdc++.h>
#include <iostream>
#include <vector>

#define rep(i, n) for (int i = 0; i < (n); ++i)
#define repr(i, n) for (int i = 0; i < (f); --i)
using namespace std;
using ll = long long;
using P = pair<int, int>;

const int MAX = 100;
const int INF = (1 << 12);

int main() {
  int n, m, c;
  cin >> n >> m >> c;

  vector<int> B(m);
  rep(i, m) cin >> B[i];

  int ans = 0;
  rep(i, n) {
    int sum = c;
    rep(j, m) {
      int a;
      cin >> a;
      sum += a * B[j];
    }
    if (sum > 0)
      ans++;
  }
  cout << ans << endl;
  return 0;
}
Problem p03102 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;

int main() {
  int N, M, C;
  int ans = 0;
  cin >> N >> M >> C;

  vector<int> B(M);
  for (int i = 0; i < M; i++) {
    cin >> B[i];
  }
  vector<vector<int>> A(N, vector<int>(N));
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < M; j++) {
      cin >> A[i][j];
    }
  }

  for (int i = 0; i < N; i++) {
    int sum = 0;
    for (int j = 0; j < M; j++) {
      sum += A[i][j] * B[j];
    }
    sum += C;
    if (sum > 0)
      ans++;
  }

  cout << ans << endl;
}

Fixed submission:
#include <bits/stdc++.h>
using namespace std;

int main() {
  int N, M, C;
  int ans = 0;
  cin >> N >> M >> C;

  vector<int> B(M);
  for (int i = 0; i < M; i++) {
    cin >> B[i];
  }
  vector<vector<int>> A(N, vector<int>(M));
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < M; j++) {
      cin >> A[i][j];
    }
  }

  for (int i = 0; i < N; i++) {
    int sum = 0;
    for (int j = 0; j < M; j++) {
      sum += A[i][j] * B[j];
    }
    sum += C;
    if (sum > 0)
      ans++;
  }

  cout << ans << endl;
}
Problem p03102 (C++)

Buggy submission (status: Runtime Error):
#include <algorithm>
#include <climits>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>

using namespace std;

#define rep(i, n) for (int i = 0; i < n; i++)
#define rept(i, a, b) for (int i = a; i < b; i++)
#define ll long long

#define IMIN INT_MIN;
#define IMAX INT_MAX;

int main() {
  int N, M, C;
  cin >> N >> M >> C;
  vector<int> B(M);
  rep(i, M) cin >> B[i];
  int A[M][N];
  int cnt = 0;
  int rowsum;
  rep(i, N) {
    rowsum = 0;
    rep(j, M) {
      cin >> A[i][j];
      rowsum += A[i][j] * B[j];
    }
    if (rowsum + C > 0)
      cnt++;
  }
  cout << cnt << endl;

  return 0;
}


Fixed submission:
#include <algorithm>
#include <climits>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>

using namespace std;

#define rep(i, n) for (int i = 0; i < n; i++)
#define rept(i, a, b) for (int i = a; i < b; i++)
#define ll long long

#define IMIN INT_MIN;
#define IMAX INT_MAX;

int main() {
  int N, M, C;
  cin >> N >> M >> C;
  vector<int> B(M);
  rep(i, M) cin >> B[i];
  int A[N][M];
  int cnt = 0;
  int rowsum;
  rep(i, N) {
    rowsum = 0;
    rep(j, M) {
      cin >> A[i][j];
      rowsum += A[i][j] * B[j];
    }
    if (rowsum + C > 0)
      cnt++;
  }
  cout << cnt << endl;

  return 0;
}
Problem p03102 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;

int main() {
  int n, m, c;
  cin >> n >> m >> c;

  vector<int> bm(m);
  for (int i = 0; i < m; i++)
    cin >> bm[i];

  vector<vector<int>> am(n, vector<int>(n));
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      cin >> am[i][j];
    }
  }

  int answer = 0;

  for (int i = 0; i < n; i++) {
    long long sum = c;
    for (int j = 0; j < m; j++) {
      sum += bm[j] * am[i][j];
    }
    if (sum > 0)
      answer++;
  }

  cout << answer << endl;
}

Fixed submission:
#include <bits/stdc++.h>
using namespace std;

int main() {
  int n, m, c;
  cin >> n >> m >> c;

  vector<int> bm(m);
  for (int i = 0; i < m; i++)
    cin >> bm[i];

  vector<vector<int>> am(n, vector<int>(m));
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      cin >> am[i][j];
    }
  }

  int answer = 0;

  for (int i = 0; i < n; i++) {
    long long sum = c;
    for (int j = 0; j < m; j++) {
      sum += bm[j] * am[i][j];
    }
    if (sum > 0)
      answer++;
  }

  cout << answer << endl;
}
Problem p03102 (C++)

Buggy submission (status: Runtime Error):
#include <algorithm>
#include <bitset>
#include <climits>
#include <cstdio>
#include <deque>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
#define rep(i, n) for (long long i = 0; i < (long long)(n); i++)
using namespace std;
typedef long long int LL;
typedef unsigned long long int ULL;

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

  cin >> n >> m >> c;
  vector<int> b(m);
  rep(i, m) { cin >> b[i]; }
  int a[m][n];
  rep(i, n) {
    rep(j, m) { cin >> a[i][j]; }
  }
  int res = 0;
  rep(i, n) {
    LL tmp = 0;
    rep(j, m) { tmp += a[i][j] * b[j]; }
    if (tmp + c > 0) {
      res += 1;
    }
  }
  cout << res << endl;
  return 0;
}


Fixed submission:
#include <algorithm>
#include <bitset>
#include <climits>
#include <cstdio>
#include <deque>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
#define rep(i, n) for (long long i = 0; i < (long long)(n); i++)
using namespace std;
typedef long long int LL;
typedef unsigned long long int ULL;

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

  cin >> n >> m >> c;
  vector<int> b(m);
  rep(i, m) { cin >> b[i]; }
  vector<vector<int>> a(n, vector<int>(m, 0));
  ;
  rep(i, n) {
    rep(j, m) { cin >> a[i][j]; }
  }
  int res = 0;
  rep(i, n) {
    LL tmp = 0;
    rep(j, m) { tmp += a[i][j] * b[j]; }
    if (tmp + c > 0) {
      res += 1;
    }
  }
  cout << res << endl;
  return 0;
}
Problem p03102 (C++)

Buggy submission (status: Runtime Error):
// #define _GLIBCXX_DEBUG

#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9 + 5;
typedef long long ll;

int main() {
  int n, m, c;
  int count = 0;
  cin >> n >> m >> c;
  vector<int> b(n);
  vector<vector<int>> a(n, vector<int>(m));
  for (int i = 0; i < m; i++)
    cin >> b[i];
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++)
      cin >> a[i][j];
  }
  for (int i = 0; i < n; i++) {
    int sum = 0;
    for (int j = 0; j < m; j++) {
      sum += a[i][j] * b[j];
    }
    sum += c;
    if (sum > 0)
      count++;
  }
  cout << count << endl;
}

Fixed submission:
// #define _GLIBCXX_DEBUG

#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9 + 5;
typedef long long ll;

int main() {
  int n, m, c;
  int count = 0;
  cin >> n >> m >> c;
  int b[30];
  int a[30][30];
  for (int i = 0; i < m; i++)
    cin >> b[i];
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++)
      cin >> a[i][j];
  }
  for (int i = 0; i < n; i++) {
    int sum = 0;
    for (int j = 0; j < m; j++) {
      sum += a[i][j] * b[j];
    }
    sum += c;
    if (sum > 0)
      count++;
  }
  cout << count << endl;
}
Problem p03102 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;

int main() {
  int N, M, C;
  cin >> N >> M >> C;
  int B[M];
  vector<vector<int>> A(N, vector<int>(M));
  for (int i = 0; i < M; i++)
    cin >> B[i];
  for (int i = 0; i < M; i++) {
    for (int j = 0; j < N; j++) {
      cin >> A[i][j];
    }
  }
  int count = 0;
  for (int i = 0; i < N; i++) {
    int ans = 0;
    for (int j = 0; j < M; j++) {
      ans += A[i][j] * B[j];
    }
    if (ans + C > 0)
      count++;
  }
  cout << count << endl;
}


Fixed submission:
#include <bits/stdc++.h>
using namespace std;

int main() {
  int N, M, C;
  cin >> N >> M >> C;
  int B[M];
  vector<vector<int>> A(N, vector<int>(M));
  for (int i = 0; i < M; i++)
    cin >> B[i];
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < M; j++) {
      cin >> A[i][j];
    }
  }
  int count = 0;
  for (int i = 0; i < N; i++) {
    int ans = 0;
    for (int j = 0; j < M; j++) {
      ans += A[i][j] * B[j];
    }
    if (ans + C > 0)
      count++;
  }
  cout << count << endl;
}
Problem p03102 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
using namespace std;
using vi = vector<int>;
int main() {
  int N, M, C;
  cin >> N >> M >> C;
  vi B = vi(10);
  FOR(i, 0, M) cin >> B[i];
  int ans = 0;
  FOR(k, 0, N) {
    int sum = C;
    FOR(i, 0, M) {
      int A_i;
      cin >> A_i;
      sum += A_i * B[i];
    }
    if (sum > 0)
      ans++;
  }
  cout << ans << endl;
  return 0;
}

Fixed submission:
#include <bits/stdc++.h>
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
using namespace std;
using vi = vector<int>;
int main() {
  int N, M, C;
  cin >> N >> M >> C;
  vi B = vi(M);
  FOR(i, 0, M) cin >> B[i];
  int ans = 0;
  FOR(k, 0, N) {
    int sum = C;
    FOR(i, 0, M) {
      int A_i;
      cin >> A_i;
      sum += A_i * B[i];
    }
    if (sum > 0)
      ans++;
  }
  cout << ans << endl;
  return 0;
}
Problem p03102 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M, C;
  cin >> N >> M >> C;
  int A;
  vector<int> B(M);
  // vector<vector<int>> A = vector<vector<int>>(N, vector<int>(M));
  int cnt = 0;
  for (int i = 0; i < M; i++) {
    cin >> B.at(i);
  }
  for (int i = 0; i < N; i++) {
    int sum = C;
    for (int j = 0; j < M; j++) {
      cin >> A;
      sum += A * B.at(i);
    }
    if (sum > 0) {
      cnt++;
    }
  }
  cout << cnt;
}


Fixed submission:
#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M, C;
  cin >> N >> M >> C;
  int A;
  vector<int> B(M);
  // vector<vector<int>> A = vector<vector<int>>(N, vector<int>(M));
  int cnt = 0;
  for (int i = 0; i < M; i++) {
    cin >> B.at(i);
  }
  for (int i = 0; i < N; i++) {
    int sum = C;
    for (int j = 0; j < M; j++) {
      cin >> A;
      sum += A * B.at(j);
    }
    if (sum > 0) {
      cnt++;
    }
  }
  cout << cnt;
}
Problem p03102 (C++)

Buggy submission (status: Runtime Error):
#include <iostream>
using namespace std;

int main() {
  /*input*/
  int n, m, c;
  cin >> n >> m >> c;
  int *b = new int[m];
  int **a = new int *[n];
  for (int i = 0; i < n; i++) {
    a[i] = new int[m];
  }
  for (int i = 0; i < m; i++) {
    cin >> b[i];
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      cin >> a[i][j];
    }
  }
  /*calculation*/
  int o = 0;
  for (int i = 0; i < n; i++) {
    int wa = 0;
    for (int j = 0; j < m; j++) {
      wa += a[i][j] * b[j];
    }
    wa += c;
    if (wa > 0) {
      o++;
    }
  }
  /*output*/
  cout << o << endl;
  delete[] b;
  for (int i = 0; i < m; i++) {
    delete[] a[i];
  }
  delete[] a;
}


Fixed submission:
#include <iostream>
using namespace std;

int main() {
  /*input*/
  int n, m, c;
  cin >> n >> m >> c;
  int *b = new int[m];
  int **a = new int *[n];
  for (int i = 0; i < n; i++) {
    a[i] = new int[m];
  }
  for (int i = 0; i < m; i++) {
    cin >> b[i];
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      cin >> a[i][j];
    }
  }
  /*calculation*/
  int o = 0;
  for (int i = 0; i < n; i++) {
    int wa = 0;
    for (int j = 0; j < m; j++) {
      wa += a[i][j] * b[j];
    }
    wa += c;
    if (wa > 0) {
      o++;
    }
  }
  /*output*/
  cout << o << endl;
  delete[] b;
  for (int i = 0; i < n; i++) {
    delete[] a[i];
  }
  delete[] a;
}
Problem p03102 (C++)

Buggy submission (status: Runtime Error):
#include <algorithm>
#include <cmath>
#include <deque>
#include <iostream>
#include <string>
#include <vector>
using namespace std;

int main() {

  int N, M, C;
  int B[M];
  int A[N][M];
  cin >> N >> M >> C;
  for (int i = 0; i < M; i++) {
    cin >> B[i];
  }

  for (int i = 0; i < N; i++) {
    for (int j = 0; j < M; j++) {
      cin >> A[i][j];
    }
  }

  int ans = 0;

  for (int i = 0; i < N; i++) {
    int sum = C;
    for (int j = 0; j < M; j++) {
      sum += (A[i][j] * B[j]);
    }
    if (sum > 0)
      ans++;
  }

  cout << ans << endl;
}


Fixed submission:
#include <algorithm>
#include <cmath>
#include <deque>
#include <iostream>
#include <string>
#include <vector>
using namespace std;

int main() {

  int N, M, C;
  int B[110];
  int A[110][110];
  cin >> N >> M >> C;
  for (int i = 0; i < M; i++) {
    cin >> B[i];
  }

  for (int i = 0; i < N; i++) {
    for (int j = 0; j < M; j++) {
      cin >> A[i][j];
    }
  }

  int ans = 0;

  for (int i = 0; i < N; i++) {
    int sum = C;
    for (int j = 0; j < M; j++) {
      sum += (A[i][j] * B[j]);
    }
    if (sum > 0)
      ans++;
  }

  cout << ans << endl;
}
Problem p03102 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <algorithm>
#include <iostream>
using namespace std;

int main() {
  int n, m, c, num[21][21], nn, sum;
  while (scanf("%d%d%d", &n, &m, &c)) {
    nn = 0;
    for (int j = 0; j < m; j++)
      scanf("%d", &num[0][j]);
    for (int i = 1; i <= n; i++) {
      sum = c;
      for (int j = 0; j < m; j++) {
        scanf("%d", &num[i][j]);
        sum += num[i][j] * num[0][j];
      }
      if (sum > 0)
        nn++;
    }
    cout << nn << endl;
  }

  return 0;
}

Fixed submission:
#include <algorithm>
#include <iostream>
using namespace std;

int main() {
  int n, m, c, num[21][21], nn, sum;
  while (cin >> n >> m >> c) {
    nn = 0;
    for (int j = 0; j < m; j++)
      scanf("%d", &num[0][j]);
    for (int i = 1; i <= n; i++) {
      sum = c;
      for (int j = 0; j < m; j++) {
        scanf("%d", &num[i][j]);
        sum += num[i][j] * num[0][j];
      }
      if (sum > 0)
        nn++;
    }
    cout << nn << endl;
  }

  return 0;
}
Problem p03102 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef vector<LL> VI;
typedef vector<VI> VVI;
typedef pair<LL, LL> PII;
typedef vector<string> VS;
inline LL toInt(string s) {
  LL v;
  istringstream sin(s);
  sin >> v;
  return v;
}
template <class T> inline string toString(T x) {
  ostringstream sout;
  sout << x;
  return sout.str();
}
#define PB push_back
#define MP make_pair
#define SZ(a) LL((a).size())
#define EACH(x, c) for (auto x : (c))
#define EXIST(s, e) ((s).find(e) != (s).end())
#define ALL(c) (c).begin(), (c).end()
#define REVERSE(c) reverse(ALL(c))
#define SORT(c) sort(ALL(c))
#define RSORT(c) sort((c).rbegin(), (c).rend())
#define STABLE_SORT(c) stable_sort(ALL(c))
#define STABLE_RSORT(c) stable_sort((c).rbegin(), (c).rend())
#define UNIQUE(c)                                                              \
  SORT(c);                                                                     \
  (c).erase(unique(ALL(c)), (c).end());
#define FOR(i, a, b) for (LL i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)
const double INF = 1e7;
const double EPS = 1e-10;
const double PI = acos(-1.0);
#define dump(x) cerr << #x << " = " << (x) << endl;

int main() {
  LL N, M, C;
  cin >> N >> M >> C;
  VI B(M);
  REP(i, M) { cin >> B[i]; }
  VVI A(N);
  REP(i, M) { A[i].resize(M); }
  REP(i, N) {
    REP(j, M) { cin >> A[i][j]; }
  }
  LL count = 0;
  REP(i, N) {
    LL sum = C;
    REP(j, M) { sum += A[i][j] * B[j]; }
    if (sum > 0) {
      count++;
    }
  }

  cout << count << endl;

  return 0;
}


Fixed submission:
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef vector<LL> VI;
typedef vector<VI> VVI;
typedef pair<LL, LL> PII;
typedef vector<string> VS;
inline LL toInt(string s) {
  LL v;
  istringstream sin(s);
  sin >> v;
  return v;
}
template <class T> inline string toString(T x) {
  ostringstream sout;
  sout << x;
  return sout.str();
}
#define PB push_back
#define MP make_pair
#define SZ(a) LL((a).size())
#define EACH(x, c) for (auto x : (c))
#define EXIST(s, e) ((s).find(e) != (s).end())
#define ALL(c) (c).begin(), (c).end()
#define REVERSE(c) reverse(ALL(c))
#define SORT(c) sort(ALL(c))
#define RSORT(c) sort((c).rbegin(), (c).rend())
#define STABLE_SORT(c) stable_sort(ALL(c))
#define STABLE_RSORT(c) stable_sort((c).rbegin(), (c).rend())
#define UNIQUE(c)                                                              \
  SORT(c);                                                                     \
  (c).erase(unique(ALL(c)), (c).end());
#define FOR(i, a, b) for (LL i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)
const double INF = 1e7;
const double EPS = 1e-10;
const double PI = acos(-1.0);
#define dump(x) cerr << #x << " = " << (x) << endl;

int main() {
  LL N, M, C;
  cin >> N >> M >> C;
  VI B(M);
  REP(i, M) { cin >> B[i]; }
  VVI A(N);
  REP(i, N) { A[i].resize(M); }
  REP(i, N) {
    REP(j, M) { cin >> A[i][j]; }
  }
  LL count = 0;
  REP(i, N) {
    LL sum = C;
    REP(j, M) { sum += A[i][j] * B[j]; }
    if (sum > 0) {
      count++;
    }
  }

  cout << count << endl;

  return 0;
}
Problem p03102 (C++)

Buggy submission (status: Runtime Error):
#include <iostream>
#include <vector>

int main() {
  int n, m, c;
  std::cin >> n >> m >> c;
  std::vector<long long> b(n, 0);
  int a = 0;
  for (int mm = 0; mm < m; mm++) {
    std::cin >> b[mm];
  }

  for (int nn = 0; nn < n; nn++) {
    long long s = 0;
    for (int mm = 0; mm < m; mm++) {
      int a;
      std::cin >> a;
      s += a * b[mm];
    }
    if (s + c > 0) {
      a++;
    }
  }
  std::cout << a << std::endl;
  return 0;
}

Fixed submission:
#include <iostream>
#include <vector>

int main() {
  int n, m, c;
  std::cin >> n >> m >> c;
  std::vector<long long> b(m, 0);
  int a = 0;
  for (int mm = 0; mm < m; mm++) {
    std::cin >> b[mm];
  }

  for (int nn = 0; nn < n; nn++) {
    long long s = 0;
    for (int mm = 0; mm < m; mm++) {
      int a;
      std::cin >> a;
      s += a * b[mm];
    }
    if (s + c > 0) {
      a++;
    }
  }
  std::cout << a << std::endl;
  return 0;
}
Problem p03102 (C++)

Buggy submission (status: Runtime Error):
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>

using namespace std;
typedef long long ll;
using Pll = pair<ll, ll>;

const ll INF = 1LL << 60;
const ll MOD = 1000000007;

// cout << fixed << setprecision(10);

int main() {
  ll N, M, C;
  cin >> N >> M >> C;
  vector<ll> B(N);
  for (int i = 0; i < M; i++)
    cin >> B[i];
  ll ans = 0;
  for (int i = 0; i < N; i++) {
    ll sum = C;
    for (int j = 0; j < M; j++) {
      ll tmp;
      cin >> tmp;
      sum += tmp * B[j];
    }
    if (sum > 0)
      ans++;
  }
  cout << ans << endl;

  return 0;
}

Fixed submission:
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>

using namespace std;
typedef long long ll;
using Pll = pair<ll, ll>;

const ll INF = 1LL << 60;
const ll MOD = 1000000007;

// cout << fixed << setprecision(10);

int main() {
  ll N, M, C;
  cin >> N >> M >> C;
  vector<ll> B(M);
  for (int i = 0; i < M; i++)
    cin >> B[i];
  ll ans = 0;
  for (int i = 0; i < N; i++) {
    ll sum = C;
    for (int j = 0; j < M; j++) {
      ll tmp;
      cin >> tmp;
      sum += tmp * B[j];
    }
    if (sum > 0)
      ans++;
  }
  cout << ans << endl;

  return 0;
}
Problem p03102 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
#define rep(i, a, n) for (int i = a; i < n; i++)
#define repr(i, a, n) for (int i = n - 1; i >= a; i--)
using namespace std;
using ll = long long;
using P = pair<int, int>;
template <typename T> void chmin(T &a, T b) { a = min(a, b); }
template <typename T> void chmax(T &a, T b) { a = max(a, b); }

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);

  int n, m, c;
  cin >> n >> m >> c;
  vector<int> b(n);
  rep(i, 0, m) cin >> b[i];

  int ans = 0;
  rep(i, 0, n) {
    int sum_val = 0;
    rep(j, 0, m) {
      int a;
      cin >> a;
      sum_val += a * b[j];
    }
    if (sum_val + c > 0)
      ans++;
  }
  cout << ans << endl;
}


Fixed submission:
#include <bits/stdc++.h>
#define rep(i, a, n) for (int i = a; i < n; i++)
#define repr(i, a, n) for (int i = n - 1; i >= a; i--)
using namespace std;
using ll = long long;
using P = pair<int, int>;
template <typename T> void chmin(T &a, T b) { a = min(a, b); }
template <typename T> void chmax(T &a, T b) { a = max(a, b); }

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);

  int n, m, c;
  cin >> n >> m >> c;
  vector<int> b(m);
  rep(i, 0, m) cin >> b[i];

  int ans = 0;
  rep(i, 0, n) {
    int sum_val = 0;
    rep(j, 0, m) {
      int a;
      cin >> a;
      sum_val += a * b[j];
    }
    if (sum_val + c > 0)
      ans++;
  }
  cout << ans << endl;
}
Problem p03102 (C++)

Buggy submission (status: Runtime Error):
#include <algorithm>
#include <iostream>
#include <string>
#include <vector>
using namespace std;

int main() {
  int N, M, C;
  cin >> N >> M >> C;
  vector<int> B(M);
  vector<vector<int>> A(M, vector<int>(N));
  for (int i = 0; i < M; i++)
    cin >> B[i];
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < M; j++) {
      cin >> A[i][j];
    }
  }
  int sum = 0, ans = 0;
  for (int i = 0; i < N; i++, sum = 0) {
    for (int j = 0; j < M; j++) {
      sum += A[i][j] * B[j];
    }
    if (sum + C > 0)
      ans++;
  }
  cout << ans << endl;

  return 0;
}

Fixed submission:
#include <algorithm>
#include <iostream>
#include <string>
#include <vector>
using namespace std;

int main() {
  int N, M, C;
  cin >> N >> M >> C;
  vector<int> B(M);
  vector<vector<int>> A(N, vector<int>(M));
  for (int i = 0; i < M; i++)
    cin >> B[i];
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < M; j++) {
      cin >> A[i][j];
    }
  }
  int sum = 0, ans = 0;
  for (int i = 0; i < N; i++, sum = 0) {
    for (int j = 0; j < M; j++) {
      sum += A[i][j] * B[j];
    }
    if (sum + C > 0)
      ans++;
  }
  cout << ans << endl;

  return 0;
}
Problem p03102 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
#define ALL(x) x.begin(), x.end()

int main() {
  int n, m, c, ans = 0;
  cin >> n >> m >> c;
  int b[m];
  for (int i = 0; i < m; i++)
    cin >> b[i];

  int a[m][n];
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      cin >> a[i][j];
    }
  }
  for (int i = 0; i < n; i++) {
    int count = 0;
    for (int j = 0; j < m; j++) {
      count += a[i][j] * b[j];
      // cout << count << "\n";
    }
    if (count + c > 0)
      ans++;
  }
  cout << ans;
}


Fixed submission:
#include <bits/stdc++.h>
using namespace std;
#define ALL(x) x.begin(), x.end()

int main() {
  int n, m, c, ans = 0;
  cin >> n >> m >> c;
  int b[m];
  for (int i = 0; i < m; i++)
    cin >> b[i];

  int a[n][m];
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      cin >> a[i][j];
    }
  }
  for (int i = 0; i < n; i++) {
    int count = 0;
    for (int j = 0; j < m; j++) {
      count += a[i][j] * b[j];
      // cout << count << "\n";
    }
    if (count + c > 0)
      ans++;
  }
  cout << ans;
}
Problem p03102 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#define rep(i, n) for (int(i) = 0; (i) < (n); ++(i))
#define repp(i, n) for (int(i) = 1; (i) <= (n); ++(i))
#define popcnt __builtin_popcount
#define all(v) v.begin(), v.end()
#define _Pi 3.1415926535
#define _MOD = 1e9 + 7;
using namespace std;
using ll = long long;
using pint = pair<int, int>;
using itn = int;
using vint = vector<int>;
template <class T> inline bool chmax(T &a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T> inline bool chmin(T &a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T> T gcd(T a, T b) { return b ? GCD(b, a % b) : a; }
template <class T> T lcm(T a, T b) { return a * b / GCD(a, b); }

int main() {
  int n, m, c;
  cin >> n >> m >> c;
  vint b(m);
  rep(i, m) cin >> b[i];
  vector<vint> a(n, vint(n));
  rep(i, n) rep(j, m) cin >> a[i][j];
  int ans = 0, sum;

  rep(i, n) {
    sum = c;
    rep(j, m) { sum += a[i][j] * b[j]; }
    if (sum > 0)
      ++ans;
  }

  cout << ans << endl;

  return 0;
}


Fixed submission:
#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#define rep(i, n) for (int(i) = 0; (i) < (n); ++(i))
#define repp(i, n) for (int(i) = 1; (i) <= (n); ++(i))
#define popcnt __builtin_popcount
#define all(v) v.begin(), v.end()
#define _Pi 3.1415926535
#define _MOD = 1e9 + 7;
using namespace std;
using ll = long long;
using pint = pair<int, int>;
using itn = int;
using vint = vector<int>;
template <class T> inline bool chmax(T &a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T> inline bool chmin(T &a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T> T gcd(T a, T b) { return b ? GCD(b, a % b) : a; }
template <class T> T lcm(T a, T b) { return a * b / GCD(a, b); }

int main() {
  int n, m, c;
  cin >> n >> m >> c;
  vint b(m);
  rep(i, m) cin >> b[i];
  vector<vint> a(n, vint(m));
  rep(i, n) rep(j, m) cin >> a[i][j];
  int ans = 0, sum;

  rep(i, n) {
    sum = c;
    rep(j, m) { sum += a[i][j] * b[j]; }
    if (sum > 0)
      ++ans;
  }

  cout << ans << endl;

  return 0;
}
Problem p03102 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
typedef int Int;
typedef pair<Int, Int> pii;
typedef pair<Int, double> pid;
typedef pair<double, double> pdd;
typedef pair<Int, pii> pip;
typedef pair<double, Int> pdp;
#define A first
#define B second
#define pb(x) push_back(x)
#define ALL(x) x.begin(), x.end()
#define SZ(x) (x).size()
#define CLR(x) memset(x, 0, sizeof x)
#define pdebug() printf("%d\n", __LINE__)
#define Itype(a) typeof(a.begin())
#define REP(i, a, b) for (int i = (a); i <= (b); i++)
#define FORO(i, n) REP(i, 0, (int)n - 1)
#define FORI(i, n) REP(i, 1, (int)n)
#define FORIT(i, t) for (Itype(t) i = t.begin(); i != t.end(); i++)
#define eps 1e-6
#define sqr(x) ((x) * (x))
#define dist(_a, _b) sqrt(sqr(_a.A - _b.A) + sqr(_a.B - _b.B))
#define norm(_a) sqrt(sqr(_a.A) + sqr(_a.B))
template <typename T> void getMin(T &a, T b) {
  if (a > b)
    a = b;
}
template <typename T> void getMax(T &a, T b) {
  if (a < b)
    a = b;
}
const int MOD = 1000000007;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int N, M, C;
  cin >> N >> M >> C;
  vector<int> B(M);
  int cnt = 0;
  FORO(i, M) cin >> B[i];
  FORO(i, N) {
    vector<int> A(N);
    int score = C;
    FORO(j, M) {
      cin >> A[j];
      score += A[j] * B[j];
    }
    if (score > 0)
      cnt++;
  }
  cout << cnt << endl;
  return 0;
}

Fixed submission:
#include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
typedef int Int;
typedef pair<Int, Int> pii;
typedef pair<Int, double> pid;
typedef pair<double, double> pdd;
typedef pair<Int, pii> pip;
typedef pair<double, Int> pdp;
#define A first
#define B second
#define pb(x) push_back(x)
#define ALL(x) x.begin(), x.end()
#define SZ(x) (x).size()
#define CLR(x) memset(x, 0, sizeof x)
#define pdebug() printf("%d\n", __LINE__)
#define Itype(a) typeof(a.begin())
#define REP(i, a, b) for (int i = (a); i <= (b); i++)
#define FORO(i, n) REP(i, 0, (int)n - 1)
#define FORI(i, n) REP(i, 1, (int)n)
#define FORIT(i, t) for (Itype(t) i = t.begin(); i != t.end(); i++)
#define eps 1e-6
#define sqr(x) ((x) * (x))
#define dist(_a, _b) sqrt(sqr(_a.A - _b.A) + sqr(_a.B - _b.B))
#define norm(_a) sqrt(sqr(_a.A) + sqr(_a.B))
template <typename T> void getMin(T &a, T b) {
  if (a > b)
    a = b;
}
template <typename T> void getMax(T &a, T b) {
  if (a < b)
    a = b;
}
const int MOD = 1000000007;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int N, M, C;
  cin >> N >> M >> C;
  vector<int> B(M);
  int cnt = 0;
  FORO(i, M) cin >> B[i];
  FORO(i, N) {
    vector<int> A(M);
    int score = C;
    FORO(j, M) {
      cin >> A[j];
      score += A[j] * B[j];
    }
    if (score > 0)
      cnt++;
  }
  cout << cnt << endl;
  return 0;
}
Problem p03102 (C++)

Buggy submission (status: Runtime Error):
#include <iostream>
#include <vector>
using namespace std;

int main() {
  int N, M, C, sum, res;
  cin >> N >> M >> C;
  vector<int> A, B;
  for (int i = 0; i < M; i++) {
    cin >> B.at(i);
  }
  res = 0;
  for (int j = 0; j < N; j++) {
    sum = C;
    for (int i = 0; i < M; i++) {
      cin >> A.at(i);
      sum += A.at(i) * B.at(i);
    }
    if (sum > 0) {
      res++;
    }
  }
  cout << res << endl;

  return 0;
}


Fixed submission:
#include <iostream>
#include <vector>
using namespace std;

int main() {
  int N, M, C, sum, res;
  cin >> N >> M >> C;
  vector<int> A(M), B(M);
  for (int i = 0; i < M; i++) {
    cin >> B.at(i);
  }
  res = 0;
  for (int j = 0; j < N; j++) {
    sum = C;
    for (int i = 0; i < M; i++) {
      cin >> A.at(i);
      sum += A.at(i) * B.at(i);
    }
    if (sum > 0) {
      res++;
    }
  }
  cout << res << endl;

  return 0;
}
Problem p03102 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;

int main() {
  int N, M, C;
  cin >> N >> M >> C;

  vector<int> B(M);

  for (int i = 0; i < M; i++) {
    cin >> B[i];
  }

  int count = 0;
  for (int i = 0; i < N; i++) {
    vector<int> A(N);
    long long sum = 0;

    for (int j = 0; j < M; j++) {
      cin >> A[j];
      sum += A[j] * B[j];
    }

    if (sum + C > 0) {
      count++;
    }
  }

  cout << count << endl;
}

Fixed submission:
#include <bits/stdc++.h>
using namespace std;

int main() {
  int N, M, C;
  cin >> N >> M >> C;

  vector<int> B(M);

  for (int i = 0; i < M; i++) {
    cin >> B[i];
  }

  int count = 0;
  for (int i = 0; i < N; i++) {
    vector<int> A(M);
    long long sum = 0;

    for (int j = 0; j < M; j++) {
      cin >> A[j];
      sum += A[j] * B[j];
    }

    if (sum + C > 0) {
      count++;
    }
  }

  cout << count << endl;
}
Problem p03102 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;

int main() {
  int N, M, C;
  cin >> N >> M >> C;
  vector<int> B(N);
  for (int i = 0; i < N; i++) {
    cin >> B.at(i);
  }
  vector<vector<int>> A(N, vector<int>(M));
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < M; j++) {
      cin >> A.at(i).at(j);
    }
  }
  int Count = 0;
  for (int i = 0; i < N; i++) {
    int Sum = C;
    for (int j = 0; j < M; j++) {
      Sum += A.at(i).at(j) * B.at(j);
    }
    if (Sum > 0) {
      Count++;
    }
  }
  cout << Count << endl;
}

Fixed submission:
#include <bits/stdc++.h>
using namespace std;

int main() {
  int N, M, C;
  cin >> N >> M >> C;
  vector<int> B(M);
  for (int i = 0; i < M; i++) {
    cin >> B.at(i);
  }
  vector<vector<int>> A(N, vector<int>(M));
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < M; j++) {
      cin >> A.at(i).at(j);
    }
  }
  int Count = 0;
  for (int i = 0; i < N; i++) {
    int Sum = C;
    for (int j = 0; j < M; j++) {
      Sum += A.at(i).at(j) * B.at(j);
    }
    if (Sum > 0) {
      Count++;
    }
  }
  cout << Count << endl;
}
Problem p03102 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
// B - Can you solve this?
int main(void) {
  int n, m, c;
  std::cin >> n >> m >> c;
  std::vector<int> b(n);
  for (int i = 0; i < m; i++) {
    std::cin >> b[i];
  }
  int ans = 0;
  int a, sum;
  for (int i = 0; i < n; i++) {
    sum = 0;
    for (int j = 0; j < m; j++) {
      std::cin >> a;
      sum += a * b[j];
    }
    sum += c;
    if (sum > 0) {
      ans++;
    }
  }
  std::cout << ans << std::endl;
}


Fixed submission:
#include <bits/stdc++.h>
using namespace std;
// B - Can you solve this?
int main(void) {
  int n, m, c;
  std::cin >> n >> m >> c;
  int b[m];
  for (int i = 0; i < m; i++) {
    std::cin >> b[i];
  }
  int ans = 0;
  int a, sum;
  for (int i = 0; i < n; i++) {
    sum = 0;
    for (int j = 0; j < m; j++) {
      std::cin >> a;
      sum += a * b[j];
    }
    sum += c;
    if (sum > 0) {
      ans++;
    }
  }
  std::cout << ans << std::endl;
}
Problem p03102 (Python)

Buggy submission (status: Runtime Error):
import numpy as np

if __name__ == "__main__":
    N, M, C = map(int, input().split())
    B = np.array(list(map(int, input().split())))
    A = np.array(list(map(lambda _: list(map(int, input().split())), range(N))))

    scores = np.matmul(A, B)
    print(np.sum(scores > -C))


Fixed submission:
import numpy as np

if __name__ == "__main__":
    N, M, C = map(int, input().split())
    B = np.array(list(map(int, input().split())))
    A = np.array(list(map(lambda _: list(map(int, input().split())), range(N))))

    scores = A.dot(B)
    print(np.sum(scores > -C))
Problem p03102 (Python)

Buggy submission (status: Runtime Error):
import numpy as np

n, m, c = [int(x) for x in input().split(" ")]
b = np.asarray([int(x) for x in input().split(" ")])

a = np.ndarray((n, 3), dtype=np.int32)
for i in range(n):
    a[i] = [int(x) for x in input().split(" ")]


s = np.sum(a * b, axis=1)
print(np.sum(s + c > 0))


Fixed submission:
import numpy as np

n, m, c = [int(x) for x in input().split(" ")]
b = np.asarray([int(x) for x in input().split(" ")])

a = np.ndarray((n, m), dtype=np.int32)
for i in range(n):
    a[i] = [int(x) for x in input().split(" ")]


s = np.sum(a * b, axis=1)
print(np.sum(s + c > 0))
Problem p03102 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>

using namespace std;

int main() {
#if LOCAL
  freopen("b.in", "r", stdin);
#endif
  int N, M, C;
  cin >> N >> M >> C;
  int res = 0;
  vector<int> B(N);
  for (int i = 0; i < M; i++) {
    cin >> B[i];
  }
  for (int i = 0; i < N; i++) {
    int a, sum = C;
    for (int j = 0; j < M; j++) {
      cin >> a;
      sum += a * B[j];
    }
    if (sum > 0)
      res++;
  }
  cout << res << endl;

  return 0;
}

Fixed submission:
#include <bits/stdc++.h>

using namespace std;

int main() {
#if LOCAL
  freopen("b.in", "r", stdin);
#endif
  int N, M, C;
  cin >> N >> M >> C;
  int res = 0;
  vector<int> B(M);
  for (int i = 0; i < M; i++) {
    cin >> B[i];
  }
  for (int i = 0; i < N; i++) {
    int a, sum = C;
    for (int j = 0; j < M; j++) {
      cin >> a;
      sum += a * B[j];
    }
    if (sum > 0)
      res++;
  }
  cout << res << endl;

  return 0;
}
Problem p03102 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
#define int long long
signed main() {
  const int X = 10000;

  int N, M, C, ans = 0;
  int B[X];
  int A[X][X];

  cin >> N >> M >> C;

  for (int i = 1; i <= M; i++)
    cin >> B[i];

  for (int i = 1; i <= N; i++)
    for (int j = 1; j <= M; j++)
      cin >> A[i][j];

  for (int i = 1; i <= N; i++) {
    int t = 0;
    for (int j = 1; j <= M; j++)
      t += A[i][j] * B[j];
    t += C;
    if (t > 0)
      ans++;
  }
  cout << ans << endl;
  return 0;
}

Fixed submission:
#include <bits/stdc++.h>
using namespace std;
#define int long long
signed main() {
  const int X = 10000;

  int N, M, C, ans = 0;
  int B[X];
  int A[100][100];

  cin >> N >> M >> C;

  for (int i = 1; i <= M; i++)
    cin >> B[i];

  for (int i = 1; i <= N; i++)
    for (int j = 1; j <= M; j++)
      cin >> A[i][j];

  for (int i = 1; i <= N; i++) {
    int t = 0;
    for (int j = 1; j <= M; j++)
      t += A[i][j] * B[j];
    t += C;
    if (t > 0)
      ans++;
  }
  cout << ans << endl;
  return 0;
}