QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#105753#4782. 完美的旅行123456789030 2176ms51968kbC++1412.6kb2023-05-15 11:22:282023-05-15 11:22:32

Judging History

你现在查看的是最新测评结果

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-05-15 11:22:32]
  • 评测
  • 测评结果:30
  • 用时:2176ms
  • 内存:51968kb
  • [2023-05-15 11:22:28]
  • 提交

answer

#include <bits/stdc++.h>

using namespace std ;
#define int long long

const int N = 6e5 + 5 , mod = 998244353 , G = 3 ; 

namespace BINOM {
    int inv[N] , ifac[N] , fac[N] ;
    int init(int n = N) {
        inv[1] = fac[0] = ifac[0] = 1 ; 
        for (int i = 2 ; i < n ; ++ i) inv[i] = 1ll * (mod - mod / i) * inv[mod % i] % mod ; 
        for (int i = 1 ; i < n ; ++ i) {
            fac[i] = 1ll * fac[i - 1] * i % mod ; 
            ifac[i] = 1ll * ifac[i - 1] * inv[i] % mod ; 
        }
        return 0 ; 
    }int get_binom = init() ;
    int C(int n , int m) {
        if (n < m || m < 0) return 0 ; 
        return 1ll * fac[n] * ifac[m] % mod * ifac[n - m] % mod ; 
    }
} 
using namespace BINOM ; 

int qmi(int a , int b = mod - 2) {
    int res = 1; a %= mod;
    while (b) {
        if (b & 1) res = (long long)res * a % mod;
        a = (long long)a * a % mod , b >>= 1;
    }
    return res;
}

inline void Add(int &x, int y) {
	x += y;
	if(x >= mod) x -= mod;
}
inline void Dec(int &x, int y) {
	x -= y;
	if(x < 0) x += mod;
}
inline int add(int x, int y) {
	x += y;
	if(x >= mod) x -= mod;
	return x;
}
inline int dec(int x, int y) {
	x -= y;
	if(x < 0) x += mod;
	return x;
}

namespace POLY {
    #define L(i, j, k) for(int i = (j); i <= (k); ++i)
    #define R(i, j, k) for(int i = (j); i >= (k); --i)
    #define V (*this)
    #define SZ() ((int) size())
    #define sz(a) ((int) a.size())
    #define vi vector < int >
    using ll = long long ;

    const int MOD = mod , inv2 = (MOD + 1) / 2 , _G = G ;  
    int rt[N << 1], Lim;
    int extend(int n) { return 1 << (__lg(n - 1) + 1) ; }
    int Pinit(int x) {
        for(Lim = 1; Lim < x; Lim <<= 1) ;
        for(int i = 1; i < Lim; i <<= 1) {
            int sG = qmi (_G, (MOD - 1) / (i << 1));
            rt[i] = 1;
            L(j, i + 1, i * 2 - 1) rt[j] = (ll) rt[j - 1] * sG % MOD;
        }
        return 0 ;
    }
    static int __POLY_INIT = Pinit(extend(N)) ;
    struct poly : public vector<int> {
        poly() : vi(){}
        poly(int n , int v = 0) : vi(n , v){}
        poly(vi t) : vi(t){}
        poly(initializer_list<int> li) : vi(li) {}
        int v(int i) { return i < 0 || i >= (int)size() ? 0 : V[i]; }
        void init(int n = 0) { vi(n).swap(V); }
        void clear() { init(0) ; }
        inline void dif() {
            int n = size() ; 
            for (int l = n >> 1; l >= 1; l >>= 1) 
                for(int j = 0; j < n; j += l << 1) 
                    for(int k = 0, *w = rt + l; k < l; k++, w++) {
                        int x = V[j + k], y = V[j + k + l];
                        V[j + k] = add(x, y);
                        V[j + k + l] = (ll) * w * dec(x, y) % MOD;
                    }
        }
        void dit () {
            int n = size() ; 
            for(int i = 2; i <= n; i <<= 1) 
                for(int j = 0, l = (i >> 1); j < n; j += i) 
                    for(int k = 0, *w = rt + l; k < l; k++, w++) {
                        int pa = V[j + k], pb = (ll) V[j + k + l] * *w % MOD;
                        V[j + k] = add(pa, pb), V[j + k + l] = dec(pa, pb);
                    }
            reverse(begin() + 1, end());
            for(int i = 0, iv = qmi(n); i < n; i++) V[i] = (ll) V[i] * iv % MOD;
        } 
        void trim() { while (!empty() && !back()) pop_back() ; }
        friend poly operator * (poly aa, poly bb) {
            if(!sz(aa) || !sz(bb)) return {};
            // return poly(MTT::conv(aa , bb , MOD));
            int all = sz(aa) + sz(bb) - 1 , lim = extend(all);
            aa.resize(lim), bb.resize(lim), aa.dif(), bb.dif();
            L(i, 0, lim - 1) aa[i] = (ll) aa[i] * bb[i] % MOD;
            aa.dit(), aa.resize(all);
            return aa;
        }
        poly Inv() {
            assert(empty() || V[0]);
            poly f, g , res = {qmi(V[0])} ;
            for(int m = 1, pn; m < SZ(); m <<= 1) {
                pn = m << 1, f = res, g.resize(pn), f.resize(pn);
                for(int i = 0; i < pn; i++) g[i] = v(i) ; 
                g *= f ; for(int i = 0; i < m; i++) g[i] = 0;
                g *= f , res.resize(pn);
                for(int i = m; i < min(pn, SZ()); i++) 
                    res[i] = (MOD - g[i]) % MOD;
            }
            return res.resize(SZ()) , res ;
        }
        poly operator << (int x) {
            poly zm (size() + x);
            L(i, 0, (int)size() - 1) zm[i + x] = V[i];
            return zm;
        }
        poly operator >> (int x) {
            if (x >= (int)size()) return poly();
            poly zm (size() - x);
            L(i, x , (int)size() - 1) zm[i - x] = V[i];
            return zm;
        }
        poly shift(ll k) {
            poly g = V ; 
            if (k > 0) {
                for (int i = SZ() - 1 ; i >= k ; -- i) g[i] = g[i - k] ;
                for (ll i = min((ll)SZ(), k) - 1; i >= 0 ; -- i) g[i] = 0 ; 
            }
            else if (k < 0) {
                k = -k ;
                for (int i = 0 ; i + k < SZ() ; ++ i) g[i] = g[i + k] ;
                for (ll i = max((ll)SZ() - k , 0ll) ; i < SZ() ; ++ i) g[i] = 0;
            }
            return g ;
        }
        friend pair<poly , poly> div (poly aa, poly bb) { //商,余
            aa.trim() , bb.trim();
            int n = aa.size() , m = bb.size() ;
            if (n < m) return {poly() , aa} ; 
            poly tb = bb ;
            aa.Rev() , bb.Rev() , bb.resize(n - m + 1) , bb = bb.Inv() ;
            poly cc = aa * bb ; cc.resize(n - m + 1) ; 
            cc.Rev() , aa.Rev() ; 
            poly dd = aa - tb * cc ; dd.resize(m - 1) , dd.trim() ;
            return {cc , dd} ; 
        }
        friend poly operator + (poly aa, poly bb) {
            poly res(max(sz(aa), sz(bb)));
            L(i, 0, sz(res) - 1) res[i] = add(aa.v(i), bb.v(i));
            return poly(res);
        }
        friend poly operator - (poly aa, poly bb) {
            poly res(max(sz(aa), sz(bb)));
            L(i, 0, sz(res) - 1) res[i] = dec(aa.v(i), bb.v(i));
            return poly(res);
        }
        friend poly operator * (poly aa, int bb) {
            poly res(sz(aa));
            L(i, 0, sz(aa) - 1) res[i] = (ll) aa[i] * bb % MOD;
            return res;
        }
        friend poly operator / (poly aa, poly bb) { return div(aa , bb).first ; }
        friend poly operator % (poly aa, poly bb) { return div(aa , bb).second ; }
        poly & operator += (poly o) {
            resize(max(SZ(), sz(o)));
            L(i, 0, SZ() - 1) (V[i] += o.v(i)) %= MOD;
            return V ;
        }
        poly & operator -= (poly o) {
            resize(max(SZ(), sz(o)));
            L(i, 0, SZ() - 1) (V[i] += MOD - o.v(i)) %= MOD;
            return V;
        }
        poly & operator *= (poly o) { return V = V * o; }
        poly & operator /= (poly o) { return V = V / o; }
        poly & operator %= (poly o) { return V = V % o; }
        poly Integ() {
            if(!SZ()) return poly();
            poly res(SZ() + 1);
            L(i, 1, SZ()) res[i] = (ll) V[i - 1] * inv[i] % MOD;
            return res;
        }
        poly Deriv() {
            if(!SZ()) return poly();
            poly res(SZ() - 1); 
            L(i, 1, SZ() - 1) res[i - 1] = (ll) V[i] * i % MOD;
            return res;
        }
        poly Ln() { // a[0] = 1
            poly g = (V.Inv() * V.Deriv()).Integ();
            return g.resize(SZ()), g;
        }
        poly Exp() { // a[0] = 0
            poly f , res = {1} ; 
            for(int m = 1, pn; m < SZ(); m <<= 1) {
                pn = min(m << 1, SZ()), f.resize(pn), res.resize(pn);
                for(int i = 0; i < pn; i++) f[i] = v(i);
                f -= res.Ln(), (f[0] += 1) %= MOD, res *= f, res.resize(pn); 
            }
            return res.resize(SZ()), res;
        }
        poly qpow(int x) {
            poly g(SZ()) , r = V; g[0] = 1 ; 
            for (;x;x >>= 1, r = r * r, r.resize(SZ())) 
                if (x & 1) g *= r , g.resize(SZ());
            return g; 
        }
        poly pow(int x, int rx = -1) { // x : the power % MOD; rx : the power % (MOD - 1)
            if(rx == -1) rx = x;
            int cnt = 0 , n = SZ(); 
            while (V[cnt] == 0 && cnt < n) ++ cnt;
            poly res = V >> cnt ; 
            int c = res[0], w = qmi(res[0]);
            res = (res * w).Ln();
            res = (res * x).Exp() ;
            // cout << c << ' ' << rx << ' ' << ' ' << (ll)c * c % mod << ' ' << qmi(c , rx) << '\n' ;
            res = res * qmi(c , rx);
            // if ((ll)cnt * x > n) L(i, 0, n - 1) res[i] = 0;
            // else if(cnt) {
            //     R(i, n - cnt * x - 1, 0) res[i + cnt * x] = res[i];
            //     L(i, 0, cnt * x - 1) res[i] = 0; 
            // }
            res = res.shift((ll) cnt * x);
            return res.resize(n) , res;
        }
        poly sqrt(int Rt = 1) { // a[0] = 1
            poly res = {Rt} , f; int n = SZ() ; 
            for(int m = 1, pn; m < n; m <<= 1) {
                pn = min(m << 1, n), f.resize(pn);
                for(int i = 0; i < pn; i++) f[i] = v(i);
                f += res * res, f.resize(pn), res.resize(pn), res = f * res.Inv(), res.resize(pn);
                for(int i = 0; i < pn; i++) res[i] = (ll) res[i] * inv2 % MOD;
            }
            return res;
        }
        void Rev() { reverse(begin() , end()); }
        void read() { for (int i = 0 ; i < (int)size() ; ++ i) { scanf("%d" , &V[i]); } }
        void print() {
            for (int i = 0 ; i < (int)size() || (puts("") , 0) ; ++ i) {
                printf("%d " , V[i]) ;
            }
        }
        #undef L
        #undef R
        #undef V
        #undef SZ
        #undef add
        #undef dec
        /*
        65537 = 2^16 + 1 , G = 3
        998244353 = 119 * 2^23 + 1 , G = 3
        1004535809 = 479 * 2^21 + 1 , G = 3 (>1e9)
        4179340454199820289 = 29 * 2^57 + 1 , G = 3 (>4e18)
        */
    } ;
} using namespace POLY ;
inline int read () {
	int x = 0, f = 1;
	char ch = getchar ();
	while (ch < '0' || ch > '9') f = ((ch == '-') ? -1 : f), ch = getchar ();
	while (ch >= '0' && ch <= '9') x = x * 10 + ch - '0', ch = getchar ();
	return x * f;
}
inline void write (int x) {
	if (x < 0) x = -x, putchar ('-');
	if (x >= 10) write (x / 10);
	putchar (x % 10 + '0');
}
int n, m;
int a[70][70];
int f[1005][40][40], g[1005][40][40];

int ans[20005][40];
signed main () {
//	freopen ("Para.in", "r", stdin);
//	freopen ("1.out", "w", stdout);
	n = read(), m = read();
	for(int i = 0; i < n; i++) for(int j = 0; j < n; j++) a[i][j] = read();
	
	for(int i = 0; i < n; i++) f[0][i][i] = g[0][i][i] = 1;
	ll B = sqrt(m) + 1;
	for(int i = 1; i <= B; i++) for(int j = 0; j < n; j++) for(int k = 0; k < n; k++) for(int jj = 0; jj < n; jj++) Add(f[i][k][j], f[i-1][k][jj] * a[jj][j] % mod);
	for(int i = 1; i <= B; i++) for(int j = 0; j < n; j++) for(int k = 0; k < n; k++) for(int jj = 0; jj < n; jj++) Add(g[i][j][k], g[i-1][jj][k] * a[j][jj] % mod);
	
	for(int i = 0; i < n; i++) for(int j = 0; j < n; j++) a[i][j] = f[B][i][j];
	memset(f, 0, sizeof f);
	for(int i = 0; i < n; i++) f[0][i][i] = 1;
	
	for(int i = 1; i <= B; i++) for(int j = 0; j < n; j++) for(int k = 0; k < n; k++) for(int jj = 0; jj < n; jj++) Add(f[i][k][j], f[i-1][k][jj] * a[jj][j] % mod);
	
	for(int x = 0; x <= B; x++) for(int k = 0; k < n; k++) for(int j = 0; (1 << j) < n; j++) for(int i = 0; i < n; i++) if(i >> j & 1) Add(f[x][i ^ (1 << j)][k], f[x][i][k]), Add(g[x][k][i ^ (1 << j)], g[x][k][i]);
	for(int d = 1; d <= m; d++) {
		int x = d / B, y = d - x * B;
//		for(int i = 0; i < n; i++) {
//			for(int j = 0; j < n; j++) {
//				for(int k = 0; k < n; k++) {
//					Add(ans[d][i&j], f[x][i][k] * g[y][k][j] % mod);
//				}
//			}
//		}
		for(int k = 0; k < n; k++) {
			for(int i = 0; i < n; i++) Add(ans[d][i], f[x][i][k] * g[y][k][i] % mod);
		}
	}
	
//	for(int t = 1; t <= m; t++) for(int j = 0; (1 << j) < n; j++) for(int i = 0; i < n; i++) if(i >> j & 1) Add(ans[t][i ^ (1 << j)], ans[t][i]);
	for(int i = 0; i < n; i++) {
		poly g;
		g.resize(m + 1);
		g[0] = 1;
		for(ll j = 1; j <= m; j++) g[j] = dec(0, ans[j][i]);
		g = g.Inv();
		for(ll j = 1; j <= m; j++) ans[j][i] = g[j];
	}
	for(int t = 1; t <= m; t++) for(int j = 0; (1 << j) < n; j++) for(int i = 0; i < n; i++) if(i >> j & 1) Dec(ans[t][i ^ (1 << j)], ans[t][i]);
	int Ans = 0;
	for(int i = 1; i <= m; i++) for(int j = 0; j < n; j++) Ans ^= ans[i][j];//, printf("?? %lld %lld %lld\n", i, j, ans[i][j]);
	write(Ans), putchar('\n');
    return 0;
}
/*
*/

详细

Subtask #1:

score: 15
Accepted

Test #1:

score: 15
Accepted
time: 30ms
memory: 38348kb

input:

4 20
53674686 128460215 363694167 120271218
578912024 941426068 993595265 587468617
731649477 694107878 355552389 226535630
99325151 243772822 66420647 578481511

output:

588479706

result:

ok 1 number(s): "588479706"

Test #2:

score: 0
Accepted
time: 60ms
memory: 40020kb

input:

16 2000
315391385 70546806 184749201 528239002 741286788 146241680 165603053 41114445 572984599 227056916 305263327 980588113 367160763 155832001 212041467 995977944
491801679 569182307 859668874 327536237 778338213 762819679 11238663 728941676 307395331 62905643 662320291 849065607 550529700 282249...

output:

808196376

result:

ok 1 number(s): "808196376"

Test #3:

score: 0
Accepted
time: 33ms
memory: 38972kb

input:

8 100
681016308 947980964 71683807 222166989 633911431 994577572 50784856 298319502
40710797 455891003 503120116 503880841 988981490 34455718 806388934 589433205
327802386 18831411 193642391 916990555 375690304 69587142 72759137 6300182
494361154 892873815 205578968 352463324 154675154 301940078 523...

output:

625872426

result:

ok 1 number(s): "625872426"

Test #4:

score: 0
Accepted
time: 26ms
memory: 39508kb

input:

8 123
42141734 119453053 338794033 469472517 896943474 997318263 463090940 539752993
498132275 425586204 10331275 799002923 314685843 769975525 214134323 412654359
293167153 22579811 116636410 566990382 581484192 102682042 582694943 865977998
241553124 317584926 931548048 157765288 390446073 1855087...

output:

365380190

result:

ok 1 number(s): "365380190"

Test #5:

score: 0
Accepted
time: 30ms
memory: 39268kb

input:

16 5
157021390 252497011 468873864 892465002 392136945 867902344 634574021 416807938 771790989 545264217 666014055 30318904 997001481 92030626 658131204 234369349
43307846 497204529 460391395 44581806 107577365 871932521 470029953 149175762 27325626 819200707 411063821 891562850 191893364 790514504 ...

output:

85280541

result:

ok 1 number(s): "85280541"

Test #6:

score: 0
Accepted
time: 22ms
memory: 39420kb

input:

16 1
905581565 803883371 222387735 113243327 962846914 170270764 908119897 643672711 951948550 443390704 345262472 285268917 716661556 492805236 516049466 646586240
717205802 712046214 204789431 592343665 608834746 958679690 85385338 156417764 101326890 777140727 427162035 294565259 28802739 8285324...

output:

17305742

result:

ok 1 number(s): "17305742"

Test #7:

score: 0
Accepted
time: 49ms
memory: 40328kb

input:

16 1889
291592828 902768692 198687222 265645285 254788066 848949408 683064381 678157787 474168528 862103895 415053306 909831425 935938735 21752343 43155905 228914827
364068446 273045932 507519451 796711939 166902447 72879739 611394755 843648198 3964648 56114938 95672745 864116356 549815108 867090999...

output:

1000245565

result:

ok 1 number(s): "1000245565"

Test #8:

score: 0
Accepted
time: 32ms
memory: 39700kb

input:

16 1538
462407755 549251277 397837861 275994586 415476819 756356324 34904944 520197632 412094442 727727503 875452091 754767133 581156730 826224521 313192343 54965862
57572067 254043810 294905166 657621093 929264117 362049084 974381916 63383415 506826999 577114576 490305008 452699725 907812132 906157...

output:

141964726

result:

ok 1 number(s): "141964726"

Test #9:

score: 0
Accepted
time: 51ms
memory: 39400kb

input:

16 1234
344382827 816941878 819839652 144225696 371171347 966266104 884665589 169825013 765791827 40228758 652684236 893817865 725991829 758836428 252384190 124837650
871491255 654941544 640590098 175202200 748370570 752347597 100539461 38637304 762795606 419148404 537316998 134122726 29051987 94573...

output:

19530996

result:

ok 1 number(s): "19530996"

Test #10:

score: 0
Accepted
time: 50ms
memory: 40556kb

input:

16 1999
12949977 632196974 390885234 944145973 121838884 405002460 237547721 700781753 461518861 947091309 820524334 253274565 296734976 893264350 934506037 438497421
658309595 402128381 470963494 423098778 698061936 170098990 137416574 542917450 696307461 580493544 236741484 982061646 908169428 985...

output:

162533703

result:

ok 1 number(s): "162533703"

Subtask #2:

score: 15
Accepted

Dependency #1:

100%
Accepted

Test #11:

score: 15
Accepted
time: 28ms
memory: 38516kb

input:

16 15
314601745 720760464 91785724 114888585 26836821 376536402 313090153 826230415 346734724 333924807 863460032 368340108 245372320 36392298 788713548 515760462
298875827 24627338 31898175 284907313 548032583 57534741 75385967 913412369 336300896 498149570 737179693 974479561 859718707 297256598 3...

output:

407303714

result:

ok 1 number(s): "407303714"

Test #12:

score: 0
Accepted
time: 428ms
memory: 45020kb

input:

32 10000
761517608 533611175 252111851 40247028 679296910 479128630 648063750 922719043 15905318 450067426 673017960 429004044 149250097 455699505 781122302 247622532 8960746 139853274 715899414 341830718 10123661 958972771 98773785 523065821 813633478 25481882 318862349 244623710 119270736 59145995...

output:

807722853

result:

ok 1 number(s): "807722853"

Test #13:

score: 0
Accepted
time: 71ms
memory: 40456kb

input:

32 1357
321954818 61258364 443769502 627726057 577984222 31067437 471030721 456785680 899823567 428940817 921238219 804535628 668867012 78750695 982200891 387928209 411806976 435420237 876420011 945079305 839002423 438946076 548079677 475785723 548284753 712759055 517364800 735798756 948763903 81555...

output:

512286475

result:

ok 1 number(s): "512286475"

Test #14:

score: 0
Accepted
time: 74ms
memory: 39608kb

input:

32 1024
934392183 278139969 946579473 404491033 120629005 736209902 839111219 891890038 147168834 726438981 379448297 349343648 888543489 398955818 91414843 460378381 720916808 485962846 92217516 88982970 894439810 677159472 350046012 746702922 908587590 702246537 685838472 411925085 380074941 68975...

output:

337041603

result:

ok 1 number(s): "337041603"

Test #15:

score: 0
Accepted
time: 30ms
memory: 39448kb

input:

32 8
837464609 53515561 24494092 954419559 538819329 215817794 44847447 557152755 311569172 386498461 978050662 953219718 194456091 857047823 966804131 200271001 662278544 873214841 562896362 46085582 976480847 935118668 490627953 405249905 90676824 444770133 132087962 554258181 870642467 293836206 ...

output:

386491936

result:

ok 1 number(s): "386491936"

Test #16:

score: 0
Accepted
time: 234ms
memory: 41320kb

input:

32 4329
574037069 402057855 471584436 536257468 210791614 335509873 350594515 331998672 619093586 234310158 72138003 640585660 992343322 649961161 435859755 715691054 54901302 186990850 897062441 60958965 397463946 94834577 114023959 124090510 486344869 100418631 317644038 885906296 414631710 391332...

output:

425277770

result:

ok 1 number(s): "425277770"

Test #17:

score: 0
Accepted
time: 239ms
memory: 41832kb

input:

32 5524
730589344 194589124 525976166 64781638 879967066 492669642 53399017 620041854 368209111 251911426 86983444 514701073 959368417 29776594 495435365 25651998 315331723 488137423 120545591 185405324 348174064 360725983 37633884 719538793 105796816 12328479 874514161 464366183 860724464 139507398...

output:

623220909

result:

ok 1 number(s): "623220909"

Test #18:

score: 0
Accepted
time: 228ms
memory: 42128kb

input:

32 6257
880226659 330483877 423871717 175591073 127434348 611932518 366082571 563944372 477260589 992476913 802786709 328672404 193010567 661448005 520335137 82252515 944511007 58280839 388765258 670185858 885749417 709317639 620145777 529001942 892659121 546946701 99505158 979528505 595220956 34078...

output:

128478743

result:

ok 1 number(s): "128478743"

Test #19:

score: 0
Accepted
time: 402ms
memory: 45604kb

input:

32 8735
245435032 953640748 241783478 331441343 87510154 136596437 138578112 967064517 314673925 833034581 212111516 834025854 882925777 582922306 314475903 638063273 171513018 434981897 367101943 378334119 3056692 809430030 4804474 70065939 593225082 236099112 574535154 887825463 386722056 88252308...

output:

405695280

result:

ok 1 number(s): "405695280"

Test #20:

score: 0
Accepted
time: 439ms
memory: 45616kb

input:

32 9999
53543452 138507371 910144777 42784030 948244479 58617879 66647526 302774961 733742236 400462082 844467039 406358748 119257486 496264675 263552002 80384519 286161937 524071888 460654447 2670531 971129382 108374548 371716781 826606146 332228173 362583611 352144250 932076012 344642595 435600511...

output:

800761072

result:

ok 1 number(s): "800761072"

Subtask #3:

score: 0
Wrong Answer

Test #21:

score: 35
Accepted
time: 395ms
memory: 51252kb

input:

16 20000
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
1 0 3 2 5 4 7 6 9 8 11 10 13 12 15 14
2 3 0 1 6 7 4 5 10 11 8 9 14 15 12 13
3 2 1 0 7 6 5 4 11 10 9 8 15 14 13 12
4 5 6 7 0 1 2 3 12 13 14 15 8 9 10 11
5 4 7 6 1 0 3 2 13 12 15 14 9 8 11 10
6 7 4 5 2 3 0 1 14 15 12 13 10 11 8 9
7 6 5 4 3 2 1 0 15 14 13 ...

output:

97601915

result:

ok 1 number(s): "97601915"

Test #22:

score: -35
Wrong Answer
time: 2176ms
memory: 51968kb

input:

64 20000
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
1 0 3 2 5 4 7 6 9 8 11 10 13 12 15 14 17 16 19 18 21 20 23 22 25 24 27 26 29 28 31 30 33 32 35 34 37 36 39 38...

output:

278828985

result:

wrong answer 1st numbers differ - expected: '709377491', found: '278828985'

Subtask #4:

score: 0
Skipped

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Dependency #3:

0%