結果
問題 |
No.1680 Sum and Difference
|
ユーザー |
|
提出日時 | 2021-09-17 21:39:44 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 327 bytes |
コンパイル時間 | 457 ms |
コンパイル使用メモリ | 63,140 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-06-29 20:04:17 |
合計ジャッジ時間 | 1,169 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 4 WA * 14 |
コンパイルメッセージ
main.cpp:15:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 15 | main() { | ^~~~
ソースコード
#include <iostream> #define int long long using namespace std; int mod = 1e9+7; int sum(int a, int b){ return (a+b)%mod; } int mul(int a,int b){ long long g = (1LL*a*b)%mod; return (int) g; } main() { int a, b; cin>>a>>b; int o = ((a+1)/2)*2, e = (a/2)*2+1; cout<<sum(mul(o,((b+1)/2)*2),mul(e,(b/2)*2+1)); return 0; }