結果
問題 |
No.1680 Sum and Difference
|
ユーザー |
|
提出日時 | 2021-09-17 23:23:42 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 438 bytes |
コンパイル時間 | 1,503 ms |
コンパイル使用メモリ | 165,356 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-29 22:13:48 |
合計ジャッジ時間 | 1,967 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 18 |
ソースコード
#include <bits/stdc++.h> using namespace std; #define rep(i,n) for(int i=0; i<(n); i++) #define INF ((1LL<<62)-(1LL<<31)) #define all(a) (a).begin(),(a).end() #define rall(a) (a).rbegin(),(a).rend() typedef long long ll; typedef pair<ll,ll> pl; const ll mod=1000000007; int main() { ll a,b; cin >> a >> b; ll ans=((a%mod)*(b%mod)*2+a+b)%mod; if((a+b)%2==0) ans++; ans%=mod; cout << ans << endl; return 0; }