結果

問題 No.2847 Birthday Attack
ユーザー AngrySadEight
提出日時 2024-07-05 01:30:48
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 421 bytes
コンパイル時間 777 ms
コンパイル使用メモリ 72,828 KB
最終ジャッジ日時 2025-02-22 02:08:53
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other WA * 14
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <algorithm>
#include <iostream>
#include <utility>
#include <vector>
using namespace std;
using ll = long long;

int main() {
    ll X, Y, M;
    cin >> X >> Y >> M;
    ll ans = 0;
    for (ll i = 1; i <= X; i++) {
        ans += 2 * max(X - 2 * i, 0LL) * Y;
        ans %= M;
    }
    for (ll i = 1; i <= Y; i++) {
        ans += 2 * max(Y - 2 * i, 0LL) * X;
        ans %= M;
    }
    cout << ans << endl;
}
0