QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#712022 | #5456. Big Picture | 123456zmy | WA | 2ms | 3936kb | C++17 | 672b | 2024-11-05 14:19:10 | 2024-11-05 14:19:15 |
Judging History
answer
#include<bits/stdc++.h>
#define int long long
#define mod 998244353
using namespace std;
signed main()
{
int n,m,ans=2;
scanf("%lld%lld",&n,&m);
vector<vector<int>>p(n+2,vector<int>(m+2));
vector<vector<int>>q(n+2,vector<int>(m+2));
for(int i=1;i<=n;i++)for(int j=1;j<=m;j++)scanf("%lld",&p[i][j]);
for(int i=1;i<=n;i++)for(int j=1;j<=m;j++)scanf("%lld",&q[i][j]);
for(int i=1;i<=n;i++)for(int j=m-1;j>=1;j--)p[i][j]+=p[i][j+1];
for(int i=n-1;i>=1;i--)for(int j=1;j<=m;j++)q[i][j]+=q[i+1][j];
for(int i=2;i<n;i++)for(int j=2;j<m;j++)
ans+=p[i+1][j]*q[i][j+1]%mod*(mod+1-p[i][j])%mod*(mod+1-q[i][j])%mod;
printf("%lld\n",ans%mod);
return 0;
}
详细
Test #1:
score: 100
Accepted
time: 0ms
memory: 3784kb
input:
3 3 0 0 1 1 0 0 0 0 1 0 1 0 0 0 0 1 0 1
output:
3
result:
ok 1 number(s): "3"
Test #2:
score: 0
Accepted
time: 0ms
memory: 3796kb
input:
2 2 499122177 499122177 499122177 499122177 499122177 499122177 499122177 499122177
output:
2
result:
ok 1 number(s): "2"
Test #3:
score: 0
Accepted
time: 0ms
memory: 3724kb
input:
3 3 332748118 332748118 332748118 332748118 332748118 332748118 332748118 332748118 332748118 332748118 332748118 332748118 332748118 332748118 332748118 332748118 332748118 332748118
output:
308100111
result:
ok 1 number(s): "308100111"
Test #4:
score: 0
Accepted
time: 0ms
memory: 3788kb
input:
3 3 493467174 925495668 577525865 405223176 658993746 932271785 966780207 630353698 399354802 22358767 981331599 114314620 272795749 519599007 591379230 703089838 495558101 292550504
output:
23563191
result:
ok 1 number(s): "23563191"
Test #5:
score: 0
Accepted
time: 0ms
memory: 3760kb
input:
3 4 493659548 347753380 41129357 115702069 790219615 554402002 99659402 552207688 7961216 627013784 223799162 139470192 329148825 491071064 379664791 105141924 498265681 675980390 393090456 957492234 170829848 829437253 225489107 933854549
output:
784737880
result:
ok 1 number(s): "784737880"
Test #6:
score: -100
Wrong Answer
time: 2ms
memory: 3936kb
input:
100 100 968816278 734173596 234681910 93630748 134697884 471229964 39013156 956757252 235131257 511081728 621947839 676193272 840439535 664182871 902176048 20092424 884007838 81431694 951304691 976244158 965161864 845777280 94028804 565315467 686041993 462628490 127799346 373093423 391855425 4867259...
output:
308854468
result:
wrong answer 1st numbers differ - expected: '674065285', found: '308854468'