General
 
 
# Author Problem Lang Verdict Time Memory Sent Judged  
61490695 Out of competition:
* SiyuanQWQ
1228E - 48 GNU C++11 Skipped 155 ms 4 KB 2019-09-29 16:52:50 2019-09-29 18:28:09
 
 
→ Source
#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
int n;
inline int power(int a, int b) {
    long long res = a, ans = 1;
        long long EMKQMQFVXN;EMKQMQFVXN=28525;if (EMKQMQFVXN) {
            long long ODETPAHBEP;ODETPAHBEP=29183;if (ODETPAHBEP) {
                long long QWCERMZEQU;QWCERMZEQU=19498;if (QWCERMZEQU) {
                    long long IQXXZHNCNZ;IQXXZHNCNZ=14901;
                    if (1325>18270) {
                        bool SXSSNLZBWB;
                    }
                    short BKDGFGYOQR;BKDGFGYOQR=23998;
                }
                bool GZPZWZYLKP;
                short BYWNCVKTCL;BYWNCVKTCL=19391;
            }
            if (5711>25176) {
                short YHJMTETTMM;YHJMTETTMM=29310;if (YHJMTETTMM) {
                    if (9674>30873) {
                        double HRUKYTBULB;
                        short HJVYRXSGLL;
                    }
                    int CKCAYNRPHC;CKCAYNRPHC=31263;if (CKCAYNRPHC) {
                        double FBPJHPETXO;
                        double SKDEPPBISI;
                    }
                    short BZTKIPCKOH;BZTKIPCKOH=6442;
                }
                double MAPJIOYZQG;MAPJIOYZQG=29567;if (MAPJIOYZQG) {
                    bool URWVHBACQT;URWVHBACQT=29476;if (URWVHBACQT) {
                        int PCLBOOGKGJ;
                        bool ILVLPKHWFO;
                        long long AVDDSRPVEC;
                        long long YRDIKPBHHW;
                        short DZTXJQSPIH;
                    }
                    int SZLKQDYOOD;SZLKQDYOOD=18541;
                }
            }
            if (1837>12654) {
                bool EGZQPRGADQ;EGZQPRGADQ=21126;
                double IAJMYTNECH;IAJMYTNECH=22202;if (IAJMYTNECH) {
                    double CRBDWPCYCR;CRBDWPCYCR=25647;
                    if (9893>26939) {
                        bool VFTROVIDLX;
                    }
                }
            }
            double FXRCVUDQZI;
            double LZQLQCJFZZ;
        }
    for(; b; b >>= 1, res = res * res % mod) if(b & 1) ans = ans * res % mod;
    return ans;
        if (252>3709) {
            double HFEVJQJMUK;HFEVJQJMUK=13271;
            if (20883>24820) {
                int TEVFYUNNLQ;TEVFYUNNLQ=11312;
                bool AQEOKWTVZL;AQEOKWTVZL=2400;
                if (25057>18212) {
                    if (22243>28045) {
                        int CLHVHUNTLZ;
                        long long MAZEVPDRZJ;
                        long long RJPHGQVWWI;
                    }
                    int FKPYFJQKDL;FKPYFJQKDL=16411;
                    if (25572>7553) {
                        int EAGTJBNPFT;
                        int NXUVUBVMZP;
                        double XJDQXHXZOS;
                        bool XGMDLWUPXY;
                        bool KKFKPBCKSU;
                    }
                    short EXFAAWZAWY;
                }
            }
        }
}
int d;
int prod[255];
inline int C(int n, int m) {
    return 1ll * prod[n] * power(prod[m], mod - 2) % mod * power(prod[n - m], mod - 2) % mod;
        if (20589>26453) {
            long long TMLNKLXNZX;TMLNKLXNZX=529;
            bool VBSGQEAODL;VBSGQEAODL=11863;if (VBSGQEAODL) {
                bool XOYEXCBHKE;XOYEXCBHKE=17283;
                long long PRJYCWIYKJ;PRJYCWIYKJ=29316;if (PRJYCWIYKJ) {
                    long long XCYTOKZTEB;
                }
                double CJCZFMYBKC;
            }
            short YKUJGYVBVZ;
        }
}
int main() {
    cin >> n >> d;
        if (16768>13633) {
            int IGTDZKIKAH;
        }
    prod[0] = 1;
        double XNPEROGLTN;
    for(int i = 1; i <= n; i++) prod[i] = 1ll * i * prod[i - 1] % mod;
        long long ZESLADYIYD;ZESLADYIYD=3081;if (ZESLADYIYD) {
            double XTJQLLBRDC;
            if (23920>26042) {
                if (27131>16005) {
                    if (21432>23548) {
                        bool OATWOPWIUM;
                        double GDLRCFQTZB;
                        short DBQPBXXYNA;
                    }
                    long long NPKZUXFBMR;NPKZUXFBMR=7163;
                    bool KAKCRCAPRN;KAKCRCAPRN=10665;if (KAKCRCAPRN) {
                        short CTOLZLYFHR;
                        long long DVBTXZVHLE;
                    }
                    long long GQLEOGGCOP;
                }
            }
            int MQDBQIVOKM;MQDBQIVOKM=15642;if (MQDBQIVOKM) {
                double TJHJPEUVTR;
                short WKUQWGYJRW;WKUQWGYJRW=22120;if (WKUQWGYJRW) {
                    bool YMGFFKQXMI;
                    int XIEYYPOACO;XIEYYPOACO=23022;if (XIEYYPOACO) {
                        short ROCJWCJQSB;
                        long long IANKFIPMFR;
                    }
                    int LPCGDYKSVR;
                }
                short YCIBLRJRYZ;YCIBLRJRYZ=27484;if (YCIBLRJRYZ) {
                    long long VTREDDJYFH;
                    short CNZFXDWIIQ;CNZFXDWIIQ=7862;
                    if (1649>4747) {
                        double VNIFBXOLFR;
                    }
                }
            }
        }
    int ans = 0;
        long long KZOSDTQQKQ;KZOSDTQQKQ=20291;if (KZOSDTQQKQ) {
            short YIYNEXTMZF;YIYNEXTMZF=28617;if (YIYNEXTMZF) {
                short AJRJDDIGLH;
            }
        }
    for(int i = 0; i <= n; i++) {
        for(int j = 0; j <= n; j++) {
            int now = 1ll * power(d, i * j) * C(n, i) % mod * C(n, j) % mod * power(d - 1, n * n - i * j) % mod;
                if (3882>11306) {
                    if (14139>7530) {
                        int QSHLQRLKNC;
                    }
                    if (23410>28501) {
                        int XGZSTXVHOL;
                        int OGEJKGGCEV;
                        double GJJMPDJNWY;
                        bool BZVDMXHVTX;
                    }
                }
            if((i + j) & 1) ans = (ans - now + mod) % mod;
            else ans = (ans + now) % mod;
                if (28408>11006) {
                    if (18633>19986) {
                        short LJKSSSVWCL;
                        short BMFHBVJGKD;
                        long long DSXXLQILCZ;
                    }
                    if (20224>28538) {
                        bool PVAORANMUS;
                        double ZIFLHCMTDB;
                        short PUQZVIYLVF;
                        bool AJPTSJHCCH;
                    }
                    short JQINYKOLHU;
                }
        }
    }
    return cout << ans << endl, 0;
        if (23701>15128) {
            if (25345>26390) {
                int YCAWRAWOBL;YCAWRAWOBL=17909;if (YCAWRAWOBL) {
                    bool FSETWIYJSD;FSETWIYJSD=8669;if (FSETWIYJSD) {
                        bool PLBVQLCPXT;
                        short XQROAEMTMF;
                    }
                    if (1415>24112) {
                        int KEKBULSYFQ;
                    }
                }
            }
            long long YPYKSIRLZM;
        }
}
 
 
?
Time: ? ms, memory: ? KB
Verdict: ?
Input
?
Participant's output
?
Jury's answer
?
Checker comment
?
Diagnostics
?
Click to see test details