結果

問題 No.1825 Except One
ユーザー KudeKude
提出日時 2022-01-28 22:13:50
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,201 bytes
コンパイル時間 2,468 ms
コンパイル使用メモリ 230,400 KB
実行使用メモリ 8,260 KB
最終ジャッジ日時 2024-06-09 15:22:38
合計ジャッジ時間 3,705 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 4 ms
8,204 KB
testcase_01 AC 3 ms
8,020 KB
testcase_02 AC 4 ms
8,048 KB
testcase_03 AC 16 ms
8,068 KB
testcase_04 AC 8 ms
8,036 KB
testcase_05 AC 6 ms
8,172 KB
testcase_06 AC 5 ms
8,036 KB
testcase_07 AC 15 ms
8,156 KB
testcase_08 AC 16 ms
8,192 KB
testcase_09 AC 4 ms
8,148 KB
testcase_10 AC 11 ms
8,104 KB
testcase_11 AC 7 ms
8,100 KB
testcase_12 AC 9 ms
8,052 KB
testcase_13 AC 6 ms
8,112 KB
testcase_14 AC 4 ms
8,072 KB
testcase_15 AC 4 ms
8,160 KB
testcase_16 AC 3 ms
8,036 KB
testcase_17 AC 5 ms
8,084 KB
testcase_18 AC 3 ms
8,084 KB
testcase_19 AC 5 ms
8,208 KB
testcase_20 AC 4 ms
8,024 KB
testcase_21 AC 3 ms
8,256 KB
testcase_22 AC 4 ms
8,080 KB
testcase_23 AC 4 ms
8,204 KB
testcase_24 AC 6 ms
8,060 KB
testcase_25 AC 6 ms
8,060 KB
testcase_26 AC 5 ms
8,044 KB
testcase_27 AC 12 ms
8,088 KB
testcase_28 WA -
testcase_29 AC 4 ms
8,164 KB
testcase_30 AC 4 ms
8,160 KB
testcase_31 AC 5 ms
8,216 KB
testcase_32 AC 17 ms
8,260 KB
testcase_33 AC 4 ms
8,188 KB
testcase_34 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
namespace {
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-function"
#include<atcoder/all>
#pragma GCC diagnostic pop
using namespace std;
using namespace atcoder;
#define rep(i,n)for (int i = 0; i < int(n); ++i)
#define rrep(i,n)for (int i = int(n)-1; i >= 0; --i)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
template<class T> void chmax(T& a, const T& b) { a = max(a, b); }
template<class T> void chmin(T& a, const T& b) { a = min(a, b); }
using ll = long long;
using P = pair<int,int>;
using VI = vector<int>;
using VVI = vector<VI>;
using VL = vector<ll>;
using VVL = vector<VL>;
using mint = modint998244353;

mint dp[110][11000];

} int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  dp[0][0] = 1;
  int n;
  cin >> n;
  VI a(n);
  rep(i, n) cin >> a[i];
  sort(all(a));
  mint ans;
  for (int x: a) {
    rrep(k, n) rrep(s, 5001) if (dp[k][s] != mint()) {
      int nk = k + 1, ns = s + x;
      if (nk > 1) {
        if (ns % (nk - 1) == 0) {
          int t = ns / (nk - 1);
          if (x <= t) ans += dp[k][s];
        }
      }
      dp[nk][ns] += dp[k][s];
    }
  }
  cout << ans.val() << endl;
}
0