結果
問題 |
No.1772 Many DELETEQs
|
ユーザー |
![]() |
提出日時 | 2021-11-23 20:00:50 |
言語 | C++17(gcc12) (gcc 12.3.0 + boost 1.87.0) |
結果 |
CE
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 1,188 bytes |
コンパイル時間 | 339 ms |
コンパイル使用メモリ | 25,088 KB |
最終ジャッジ日時 | 2025-01-26 00:46:16 |
ジャッジサーバーID (参考情報) |
judge2 / judge2 |
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
コンパイルメッセージ
main.cpp:1:10: fatal error: testlib.h: No such file or directory 1 | #include "testlib.h" | ^~~~~~~~~~~ compilation terminated.
ソースコード
#include "testlib.h" #include <iostream> #include <vector> #include <atcoder/modint> using namespace std; constexpr int D = 4000; int main(int argc, char *argv[]) { registerValidation(argc, argv); vector dp(D + 1, vector<atcoder::modint998244353>(D + 1)); // dp[x][y]: 最少で AB x 個 BA y 個で作れる列の個数 dp[0][0] = 1; for (int i = 0; i < int(dp.size()); ++i) { for (int j = 0; j < int(dp[i].size()); ++j) { // AA 始まり / BB 始まり if (i and j) dp[i][j] += dp[i - 1][j - 1] * 2; // AB 始まり if (i) dp[i][j] += dp[i - 1][j]; // BA 始まり if (j) dp[i][j] += dp[i][j - 1]; } } for (int i = 1; i < int(dp.size()); ++i) { for (int j = 1; j < int(dp[i].size()); ++j) dp[i][j] += dp[i - 1][j - 1]; } int Q = inf.readInt(1, 200000); inf.readEoln(); cin.tie(nullptr); ios::sync_with_stdio(false); while (Q--) { int x = inf.readInt(1, 4000); inf.readSpace(); int y = inf.readInt(1, 4000); inf.readEoln(); cout << dp.at(x).at(y).val() << '\n'; } inf.readEof(); }