Submission #3245970


Source Code Expand

#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n - 1; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define FORR(i, m, n) for(int i = m; i >= n; i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define ll long long
#define pb(a) push_back(a)

ll dp[51][2501];

int main(){
  int n, a;
  cin >> n >> a;
  vector<int> x[n];
  REP(i, n) cin >> x[i];

  dp[0][0] = 1;

  REP(i, n){
    REPR(j, n){
      REP(k, 2501 - x[i]){
        dp[j + 1][k + x[i]] += dp[j][k];
      }
    }
  }

  ll ans = 0;
  REP(i, n + 1) ans += dp[i + 1][(i + 1) * a];

  cout << ans << endl;

}

Submission Info

Submission Time
Task C - Tak and Cards
User harsaka
Language C++14 (GCC 5.4.1)
Score 0
Code Size 726 Byte
Status CE

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:18:17: error: no match for ‘operator>>’ (operand types are ‘std::istream {aka std::basic_istream<char>}’ and ‘std::vector<int>’)
   REP(i, n) cin >> x[i];
                 ^
In file included from /usr/include/c++/5/sstream:38:0,
                 from /usr/include/c++/5/complex:45,
                 from /usr/include/c++/5/ccomplex:38,
                 from /usr/include/x86_64-linux-gnu/c++/5/bits/stdc++.h:52,
                 from ./Main.cpp:1:
/usr/include/c++/5/istream:120:7: note: candidate: std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(std::basic_istream<_CharT, _Traits>::__istream_type& (*)(std::basic_istream<_CharT, _Traits>::__istream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_istream<_CharT, _Traits>::__istream_type = std::basic_istream<char>]
       operator>>(__istream_type& (*__pf)(__istream_type&))
       ^
/usr/include/c++/5/istream:120:7: note:   no known convers...