結果

問題 No.2847 Birthday Attack
ユーザー Andrew8128Andrew8128
提出日時 2024-08-23 23:39:25
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 958 bytes
コンパイル時間 5,287 ms
コンパイル使用メモリ 307,732 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-08-23 23:39:39
合計ジャッジ時間 6,279 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 33 ms
6,812 KB
testcase_01 AC 33 ms
6,944 KB
testcase_02 AC 32 ms
6,940 KB
testcase_03 AC 32 ms
6,940 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

// 441_F.cpp   2024/08/23 23:31:48
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int mod = 998244353, mod1 = 1000000007, inf = 1070000000;
const ll linf = 4610000000000000000;
#define REP(i,x,y) for (auto i = (x); i < (y); i++)
#define RREP(i,x,y) for (auto i = (y) - 1; (x) <= i; i--)
#define ALL(x) (x).begin(), (x).end()
template<class T> bool inr(const T &l, const T &x, const T &r){return (l<=x && x<r);}
template<class T> bool chmax(T &a, const T &b){if(a < b){a = b; return 1;} else return 0;}
template<class T> bool chmin(T &a, const T &b){if(b < a){a = b; return 1;} else return 0;}
#include <atcoder/all>
using namespace atcoder;
#pragma GCC optimize("O3")
int main(){
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  ll X,Y,M;
  ll ans = 0;
  cin >> X >> Y >> M;
  REP(i,1LL,2000005LL){
    ans += max(0LL,(X-i-i)*Y);
    ans += max(0LL,(Y-i-i)*X);
    ans %= M;
  }
  ans *= 2;
  ans %= M;
  cout << ans << '\n';
}
0