結果

問題 No.1680 Sum and Difference
ユーザー Nitit Jongsawatsataporn
提出日時 2021-09-17 21:42:09
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 254 bytes
コンパイル時間 497 ms
コンパイル使用メモリ 64,004 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-29 20:06:30
合計ジャッジ時間 1,116 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 18
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;
int mod = 1e9+7;

int main() {
	long long a, b; cin>>a>>b;
	long long o = ((a+1)/2)*2, e = (a/2)*2+1;
	long long f = ((b+1)/2)*2, h = (b/2)*2+1;
	cout<<(((f%mod) * (o%mod)) + ((e%mod) * (h%mod)))%mod;
	return 0;
}
0