結果
| 問題 |
No.2944 Sigma Partition Problem
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-10-19 13:44:46 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,204 bytes |
| コンパイル時間 | 3,952 ms |
| コンパイル使用メモリ | 279,400 KB |
| 実行使用メモリ | 128,896 KB |
| 最終ジャッジ日時 | 2024-10-19 13:44:57 |
| 合計ジャッジ時間 | 9,677 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 1 WA * 23 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(ll i=0;i<(un)n;i++)
#define repa(i,n) for(ll i=1;i<(un)n;i++)
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define mod 998244353
#define dai 5000000000000000000LL
#define sho -dai
#define eps 1e-14
#define fi(x) cout<<fixed<<setprecision(x);
using ll=long long;
using un=unsigned long long;
using ld=long double;
using st=string;
using ch=char;
using bo=bool;
using P=pair<ll,ll>;
using T=tuple<ll,ll,ll>;
using vi=vector<ll>;
using vs=vector<st>;
using vc=vector<ch>;
using vb=vector<bo>;
using vp=vector<P>;
using sp=set<P>;
using ss=set<st>;
using si=set<ll>;
using vvi=vector<vi>;
using vvs=vector<vs>;
using vvb=vector<vb>;
using vvc=vector<vc>;
using vvp=vector<vp>;
using vsi=vector<set<ll>>;
const ll dx[4]={0,1,0,-1};
const ll dy[4]={1,0,-1,0};
const ll INF = 1e18;
const ll tt=998244353;
int main() {
ll n;
cin>>n;
vvi dp(4005,vi(4005));
dp[0][0]=1;
for(int i=1;i<=4000;i++){
for(int j=1;j<=i;j++){
dp[i][j]=dp[i][j-1]+dp[i-j][min(j,i-j)];
dp[i][j]%=998244353;
//cout<<dp[i][j]<<" ";
}
//cout<<endl;
}
rep(i,n){
ll a,b,c;
cin>>a>>b>>c;
cout<<dp[b][c]%998244353<<endl;
}
}