結果
| 問題 | No.1680 Sum and Difference |
| コンテスト | |
| ユーザー |
moondrink
|
| 提出日時 | 2021-09-22 20:46:52 |
| 言語 | C++14 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 359 bytes |
| 記録 | |
| コンパイル時間 | 1,167 ms |
| コンパイル使用メモリ | 178,508 KB |
| 実行使用メモリ | 6,272 KB |
| 最終ジャッジ日時 | 2026-03-26 16:24:39 |
| 合計ジャッジ時間 | 1,723 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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;
}
moondrink