結果
問題 | No.1682 Unfair Game |
ユーザー | tonyu0 |
提出日時 | 2021-09-17 22:45:27 |
言語 | C++17 (gcc 13.2.0 + boost 1.83.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 800 bytes |
コンパイル時間 | 1,719 ms |
コンパイル使用メモリ | 86,688 KB |
実行使用メモリ | 4,384 KB |
最終ジャッジ日時 | 2023-09-12 08:47:22 |
合計ジャッジ時間 | 2,877 ms |
ジャッジサーバーID (参考情報) |
judge15 / judge13 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 2 ms
4,376 KB |
testcase_01 | AC | 2 ms
4,380 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 | 1 ms
4,376 KB |
testcase_15 | AC | 1 ms
4,376 KB |
testcase_16 | AC | 1 ms
4,380 KB |
testcase_17 | WA | - |
testcase_18 | AC | 2 ms
4,376 KB |
testcase_19 | WA | - |
testcase_20 | WA | - |
testcase_21 | WA | - |
ソースコード
#include <algorithm> #include <cmath> #include <iostream> #include <numeric> #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]]) %= MOD; 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; }