結果

問題 No.1682 Unfair Game
ユーザー tonyu0tonyu0
提出日時 2021-09-17 22:43:44
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 876 bytes
コンパイル時間 942 ms
コンパイル使用メモリ 107,088 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-12 08:44:38
合計ジャッジ時間 1,968 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 2 ms
4,376 KB
testcase_15 AC 2 ms
4,376 KB
testcase_16 AC 2 ms
4,376 KB
testcase_17 WA -
testcase_18 AC 2 ms
4,376 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <algorithm>
#include <cmath>
#include <complex>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <vector>

using namespace std;
using ll = long long;
#define rep(i, j, n) for (int i = j; i < (n); ++i)
#define rrep(i, j, n) for (int i = (n)-1; j <= i; --i)
template <typename T>
std::istream &operator>>(std::istream &is, std::vector<T> &a) {
  for (T &x : a) { is >> x; }
  return is;
}
constexpr int MOD = 1000000007;
ll dp[10010];

int main() {
  cin.tie(0)->sync_with_stdio(0);
  int n;
  cin >> n;
  vector<int> p(n);
  cin >> p;
  dp[0] = 1;
  rep(i, 0, n) rrep(j, p[i], 10010) dp[j] += dp[j - p[i]];

  ll ans = 0;
  rep(i, 1, 10010) {
    int q = i / 100;
    int r = i % 100;
    if (r == 50) continue;
    if (r > 50) ++q;
    if (q & 1) (ans += dp[i]) %= MOD;
  }
  cout << ans;
  return 0;
}
0