結果
問題 | No.1772 Many DELETEQs |
ユーザー | chocorusk |
提出日時 | 2021-12-19 17:22:59 |
言語 | C++17 (gcc 12.3.0 + boost 1.83.0) |
結果 |
AC
|
実行時間 | 749 ms / 3,500 ms |
コード長 | 1,171 bytes |
コンパイル時間 | 3,524 ms |
コンパイル使用メモリ | 187,880 KB |
実行使用メモリ | 194,920 KB |
最終ジャッジ日時 | 2023-10-13 18:54:34 |
合計ジャッジ時間 | 9,760 ms |
ジャッジサーバーID (参考情報) |
judge13 / judge15 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 371 ms
194,636 KB |
testcase_01 | AC | 369 ms
194,640 KB |
testcase_02 | AC | 370 ms
194,696 KB |
testcase_03 | AC | 729 ms
194,920 KB |
testcase_04 | AC | 749 ms
194,720 KB |
testcase_05 | AC | 721 ms
194,844 KB |
testcase_06 | AC | 707 ms
194,716 KB |
ソースコード
#include <cstdio> #include <cstring> #include <iostream> #include <string> #include <cmath> #include <bitset> #include <vector> #include <map> #include <set> #include <queue> #include <deque> #include <algorithm> #include <complex> #include <unordered_map> #include <unordered_set> #include <random> #include <cassert> #include <fstream> #include <utility> #include <functional> #include <time.h> #include <stack> #include <array> #include <list> #include <atcoder/all> #define popcount __builtin_popcount using namespace std; using namespace atcoder; typedef long long ll; typedef pair<int, int> P; using mint=modint998244353; mint dp[4040][4040]; mint s[8080][4040]; int main() { dp[0][0]=1; for(int i=0; i<=4000; i++){ for(int j=0; j<=4000; j++){ dp[i+1][j]+=dp[i][j]; dp[i][j+1]+=dp[i][j]; dp[i+1][j+1]+=2*dp[i][j]; } } int q;cin>>q; for(int i=0; i<=4000; i++){ for(int j=0; j<=4000; j++){ s[i-j+4000][i]+=dp[i][j]; } } for(int i=0; i<=8000; i++){ for(int j=1; j<=4000; j++){ s[i][j]+=s[i][j-1]; } } while(q--){ int x,y;cin>>x>>y; cout<<s[x-y+4000][x].val()<<endl; } return 0; }