QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#283005#5825. 矩阵haozinojc0 0ms0kbC++14605b2023-12-13 17:38:142023-12-13 17:38:14

Judging History

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

  • [2023-12-13 17:38:14]
  • 评测
  • 测评结果:0
  • 用时:0ms
  • 内存:0kb
  • [2023-12-13 17:38:14]
  • 提交

answer

#include<bits/stdc++.h>
#define int long long
#define re register int
#define cin(x) scanf("%lld",&x)
using namespace std;
const int N=3e3+5,mod=998244353;
int a[N][N],b[N][N],c,d,n,t;
void solve(){
	cin(n);
	for(re i=1;i<=n;i++)
	for(re j=1;j<=n;j++)cin(a[i][j]);
	for(re i=1;i<=n;i++)
	for(re j=1;j<=n;j++)cin(b[i][j]);
	for(re i=1;i<=n;i++){
		for(re j=1;j<=n;j++){
			cin(c);
			for(re k=1;k<=n;k++)
				d=(d+(a[i][k]*b[k][j]%mod))%mod;
			if(c!=d){
				puts("No");
				return;
			}
		}
	}
	puts("Yes");
}
signed main(){
	cin(t);
	while(t--){
		solve();
	}
	return 0;
}

详细

Test #1:

score: 0
Time Limit Exceeded

input:

77
5
310980524 649430325 929726167 322133176 196533101
452124191 763518207 462580246 389109943 258982238
980842752 382992674 892794173 572244127 863057091
124971774 306543135 142770389 191933270 159536107
109591708 788516987 986057559 843265788 373012497
68607783 73771527 80822244 141931517 25629982...

output:


result:


Test #2:

score: 0
Time Limit Exceeded

input:

20
19
300786426 55348523 438467798 718608329 639575511 877480154 131078518 50498458 505652400 70781693 60607235 327377105 962399950 299685377 189021169 768713056 159947767 323830788 939451729
663015053 702349816 47032062 144232075 8590829 314695773 653195451 79047310 190236549 193759597 40824001 648...

output:


result:


Test #3:

score: 0
Time Limit Exceeded

input:

17
1596
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

output:


result:


Test #4:

score: 0
Time Limit Exceeded

input:

67
1434
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

output:


result:


Test #5:

score: 0
Time Limit Exceeded

input:

56
1496
827382385 334050842 562523170 64248344 772202392 344227963 962535698 610424680 191764282 201712819 261741289 38707441 723490918 616784554 656880245 541289597 106479168 181789413 983195098 366707435 245960214 738618459 166000436 637820477 108811383 83646606 418099171 704739401 10052747 848798...

output:


result:


Test #6:

score: 0
Time Limit Exceeded

input:

20
1603
91905310 952717462 954485887 678448563 186981847 978898327 338140536 142208894 826264776 31056661 228690801 739960038 636575118 693539178 552731649 447161207 735822147 549896101 448501798 249993628 232603979 651172711 525376001 686066708 334392371 31224732 830607244 501599631 12908074 490182...

output:


result:


Test #7:

score: 0
Time Limit Exceeded

input:

83
1504
312926430 470364934 584087355 865456364 663314460 144864284 86040064 304739271 52110782 189905783 204867442 654669354 700416903 873419055 247798007 336659255 547886460 35701369 50399953 750825612 232240264 279725763 390903577 254078528 123437599 833862824 919919348 664000739 203075130 525566...

output:


result:


Test #8:

score: 0
Time Limit Exceeded

input:

92
1491
422064757 810225812 58914901 70234338 273595204 258594523 880518679 942823445 991245948 834057054 985736324 626095263 195913075 708777902 158324260 624966332 989571760 895942048 76442464 377096766 794818118 240859092 475927849 113281577 787350276 276940304 971362517 217702894 867701250 98410...

output:


result:


Test #9:

score: 0
Time Limit Exceeded

input:

58
1499
751071830 198863820 292534250 533580356 205272669 522998611 544079196 862157715 390778805 173487948 2829675 199144838 675250424 278673908 174319522 917235530 482538942 310120418 499417216 744352970 198105466 851050201 324562569 348438015 496335083 992485291 846615552 237913613 805117120 5265...

output:


result:


Test #10:

score: 0
Time Limit Exceeded

input:

63
1522
804799017 382423356 136999262 517603642 272623548 81400703 177936492 183644706 811008901 195348189 420358926 621889115 536952352 617681319 415690825 430566736 944543466 941130403 758469932 177203809 35830351 321068848 919341658 612155458 741714933 350499007 364263342 739984562 253160541 1993...

output:


result: