結果

問題 No.1756 Rider's Triangle
ユーザー chocoruskchocorusk
提出日時 2021-11-20 17:13:01
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 8 ms / 2,000 ms
コード長 1,221 bytes
コンパイル時間 3,413 ms
コンパイル使用メモリ 188,800 KB
実行使用メモリ 19,284 KB
最終ジャッジ日時 2023-09-02 12:40:41
合計ジャッジ時間 4,838 ms
ジャッジサーバーID
(参考情報)
judge13 / judge16
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 7 ms
19,012 KB
testcase_01 AC 8 ms
19,160 KB
testcase_02 AC 7 ms
19,100 KB
testcase_03 AC 8 ms
19,064 KB
testcase_04 AC 8 ms
19,116 KB
testcase_05 AC 7 ms
19,044 KB
testcase_06 AC 7 ms
19,284 KB
testcase_07 AC 8 ms
19,012 KB
testcase_08 AC 7 ms
19,084 KB
testcase_09 AC 7 ms
19,016 KB
testcase_10 AC 8 ms
19,024 KB
testcase_11 AC 7 ms
19,068 KB
testcase_12 AC 7 ms
19,116 KB
testcase_13 AC 8 ms
19,052 KB
testcase_14 AC 7 ms
19,016 KB
testcase_15 AC 7 ms
19,076 KB
testcase_16 AC 8 ms
19,040 KB
testcase_17 AC 7 ms
19,192 KB
testcase_18 AC 8 ms
19,016 KB
testcase_19 AC 8 ms
19,016 KB
testcase_20 AC 8 ms
19,112 KB
testcase_21 AC 7 ms
19,020 KB
testcase_22 AC 7 ms
19,180 KB
testcase_23 AC 7 ms
19,084 KB
testcase_24 AC 8 ms
19,084 KB
testcase_25 AC 7 ms
19,016 KB
testcase_26 AC 7 ms
19,020 KB
testcase_27 AC 7 ms
19,028 KB
testcase_28 AC 8 ms
19,116 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <cmath>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>
#include <complex>
#include <unordered_map>
#include <unordered_set>
#include <random>
#include <cassert>
#include <fstream>
#include <utility>
#include <functional>
#include <time.h>
#include <stack>
#include <array>
#include <list>
#include <atcoder/all>
#define popcount __builtin_popcount
using namespace std;
using namespace atcoder;
typedef long long ll;
typedef pair<int, int> P;
using mint=modint998244353;
mint f[2000010], invf[2000010];
void fac(int n){
    f[0]=1;
    for(ll i=1; i<=n; i++) f[i]=f[i-1]*i;
    invf[n]=f[n].inv();
    for(ll i=n-1; i>=0; i--) invf[i]=invf[i+1]*(i+1);
}
mint comb(int x, int y){
    if(!(0<=y && y<=x)) return 0;
    return f[x]*invf[y]*invf[x-y];
}

int main()
{
    int a, b;
    cin>>a>>b;
    ll n;
    cin>>n;
    if(a==b || a==0){
        cout<<0<<endl;
        return 0;
    }
    int g=gcd(2*a*b, b*b-a*a);
    int s=2*a*b/g, t=(b*b-a*a)/g;
    int x=s*a+t*b, y=s*b;
    mint ans=mint(n-x)*mint(n-y);
    ans*=8;
    cout<<ans.val()<<endl;
    return 0;
}
0