比赛 2025.12.6 评测结果 WAWWWWWWWWWWWWWWWWWW
题目名称 填数游戏 最终得分 5
用户昵称 LikableP 运行时间 0.025 s
代码语言 C++ 内存使用 1.51 MiB
提交时间 2025-12-06 12:02:12
显示代码纯文本
#include <cstdio>
#include <cctype>

template <typename T> T read() {
  T res = 0, f = 1;
  char ch = getchar();
  for (; !isdigit(ch); ch = getchar()) if (ch == '-') f = -1;
  for (; isdigit(ch); ch = getchar()) res = (res << 3) + (res << 1) + (ch ^ 48);
  return res * f;
}

void write(__int128 x, char ed = '\n') {
  if (x < 0) x = -x, putchar('-');
  static int sta[64], top = 0;
  do {
    sta[++top] = x % 10;
    x /= 10;
  } while (x);
  while (top) {
    putchar(sta[top--] ^ 48);
  }
  putchar(ed);
}

template <typename T> void write(T x, char ed = '\n') {
  write((__int128)x, ed);
}

typedef long long ll;

const ll MOD = 1e9 - 7;

ll kasumi(ll x, ll y) {
  ll res = 1;
  for (; y; y >>= 1, x = x * x % MOD) if (y & 1) res = res * x % MOD;
  return res;
}

int n, m;

int main() {
  #ifdef LOCAL
    freopen("!input.in", "r", stdin);
    freopen("!output.out", "w", stdout);
  #else
    freopen("game.in", "r", stdin);
    freopen("game.out", "w", stdout);
  #endif
  n = read<int>(), m = read<int>();
  write(kasumi(2, n > m ? n : m));
  return 0;
}