結果
問題 |
No.1680 Sum and Difference
|
ユーザー |
![]() |
提出日時 | 2021-09-17 22:02:49 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 434 bytes |
コンパイル時間 | 2,103 ms |
コンパイル使用メモリ | 191,300 KB |
最終ジャッジ日時 | 2025-01-24 14:58:09 |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 4 WA * 14 |
ソースコード
#include <bits/stdc++.h> using namespace std; constexpr int mod = 1000000007; int main() { long long A,B; cin >> A >> B; long long ans = A/2*2+1; ans %= mod; ans += (A*4+2)%mod*(B/2)%mod; ans %= mod; if(B%2 == 1) { if(A%2 == 0) { ans += A*2; ans %= mod; } else { ans += A*2+2; ans %= mod; } } cout << ans << endl; }