結果
問題 |
No.1680 Sum and Difference
|
ユーザー |
![]() |
提出日時 | 2021-09-22 20:46:52 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 359 bytes |
コンパイル時間 | 1,390 ms |
コンパイル使用メモリ | 165,848 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-07-05 09:20:32 |
合計ジャッジ時間 | 2,072 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 4 WA * 14 |
ソースコード
#include<bits/stdc++.h> using namespace std; typedef long long ll; const int mod = 1e9 + 7; ll a,b; int main() { scanf("%lld %lld",&a,&b); bool f = true; if((a - b) & 1) f = false; ll ans = 0; ans = (2ll * a % mod * b % mod) + a % mod + b % mod + 1ll; ans %= mod; if(!f) ans --; printf("%lld\n",ans % mod); return 0; }