結果

問題 No.2105 Avoid MeX
ユーザー risujirohrisujiroh
提出日時 2022-10-21 23:35:51
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
RE  
実行時間 -
コード長 438 bytes
コンパイル時間 3,743 ms
コンパイル使用メモリ 244,928 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-13 23:44:32
合計ジャッジ時間 6,709 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 RE -
testcase_02 AC 1 ms
4,376 KB
testcase_03 RE -
testcase_04 RE -
testcase_05 AC 1 ms
4,380 KB
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 AC 2 ms
4,380 KB
testcase_11 AC 1 ms
4,376 KB
testcase_12 RE -
testcase_13 AC 2 ms
4,380 KB
testcase_14 RE -
testcase_15 RE -
testcase_16 AC 2 ms
4,380 KB
testcase_17 AC 2 ms
4,376 KB
testcase_18 RE -
testcase_19 RE -
testcase_20 RE -
testcase_21 RE -
testcase_22 RE -
testcase_23 AC 2 ms
4,376 KB
testcase_24 AC 2 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

#include <atcoder/modint>

using Fp = atcoder::modint998244353;

void solve(std::istream& is, std::ostream& os) {
  int C, X;
  is >> C >> X;
  if (X == 0) {
    os << Fp(C + 1).inv().val() << '\n';
  } else if (X <= C) {
    os << (1 - Fp(X + 1).inv()).val() << '\n';
  } else {
    std::abort();
  }
}

int main() {
  std::ios::sync_with_stdio(false);
  std::cin.tie(nullptr);

  solve(std::cin, std::cout);
}
0