結果

問題 No.1680 Sum and Difference
ユーザー umezo
提出日時 2021-09-17 22:58:02
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 368 bytes
コンパイル時間 2,372 ms
コンパイル使用メモリ 191,440 KB
最終ジャッジ日時 2025-01-24 15:17:23
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 18
権限があれば一括ダウンロードができます

ソースコード

diff #

#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define ALL(v) v.begin(),v.end()
typedef long long ll;
 
#include<bits/stdc++.h>
using namespace std;

const int MOD=1e9+7;
 
int main(){
  ios::sync_with_stdio(false);
  std::cin.tie(nullptr);
  
  ll a,b;
  cin>>a>>b;
  cout<<((a/2*2%MOD+1)*(b/2*2%MOD+1)%MOD+((a+1)/2*2%MOD)*((b+1)/2*2%MOD))%MOD<<endl;
    
  return 0;
}
0