結果
問題 |
No.1680 Sum and Difference
|
ユーザー |
![]() |
提出日時 | 2022-05-01 23:41:30 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 326 bytes |
コンパイル時間 | 1,494 ms |
コンパイル使用メモリ | 166,184 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-07-01 01:09:05 |
合計ジャッジ時間 | 2,429 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 10 WA * 8 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main() { int64_t A, B; cin >> A >> B; const int64_t mod = 1000000007; A %= mod; B %= mod; int64_t ans = 0; if(A % 2 == B % 2) { ans += 2 * A * B + A + B + 1; ans %= mod; } else { ans += 2 * A * B + A + B; ans %= mod; } cout << ans << endl; return 0; }