首页 > 其他分享 >CodeChef SHGAME

CodeChef SHGAME

时间:2022-10-25 09:44:50浏览次数:49  
标签:tong2 int memset SHGAME cin -- tong1 CodeChef

#include <bits/stdc++.h>
#define int long long

using namespace std;

int tong1[2323233], tong2[2323233];

signed main()
{
  int T;
  cin >> T;
  while (T --)
  {
    int n, m;
    cin >> n >> m;
    n --;
    m --;
    memset (tong1, 0, sizeof tong1);
    memset (tong2, 0, sizeof tong2);
    for (int i = 0; i <= n; i ++)
      tong1[i ^ (n - i)] ++;
    for (int i = 0; i <= m; i ++)
      tong2[i ^ (m - i)] ++;
    int res = (n + 1) * (m + 1);
    for (int i = 0; i <= 1e6; i ++)
      res -= tong1[i] * tong2[i];
    cout << res << '\n';
  }
  return 0;
}

标签:tong2,int,memset,SHGAME,cin,--,tong1,CodeChef
From: https://www.cnblogs.com/BaiduFirstSearch/p/16823856.html

相关文章