結果
問題 | No.1680 Sum and Difference |
ユーザー |
![]() |
提出日時 | 2021-09-17 22:08:04 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 359 bytes |
コンパイル時間 | 1,317 ms |
コンパイル使用メモリ | 165,908 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-29 20:41:50 |
合計ジャッジ時間 | 1,937 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 18 |
ソースコード
#include <bits/stdc++.h> using namespace std; using ll = long long; const ll MOD = 1000000007; const long long INF = 1LL << 60; #define rep(i,n) for(int i = 0; i < n; i++) #define all(x) (x).begin(),(x).end() int main() { ll a, b; cin >> a >> b; cout << ((((a/2*2+1)%MOD*(b/2%MOD))%MOD+((a+1)/2*2%MOD*((b+1)/2%MOD))%MOD)*2+a/2*2+1)%MOD << endl; }