QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#331422 | #7042. So Easy | nickoless | WA | 1ms | 3668kb | C++14 | 586b | 2024-02-18 08:41:23 | 2024-02-18 08:41:24 |
Judging History
answer
#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
const int maxn=1005;
int n,a[maxn][maxn];
int dc[maxn],dl[maxn];
int x,y;
int main(){
cin>>n;
memset(dc,0x3f,sizeof(dc));
memset(dl,0x3f,sizeof(dl));
for(int i=1;i<=n;i++)
for(int j=1;j<=n;j++){
cin>>a[i][j];
dl[i]=min(dl[i],a[i][j]);
dc[j]=min(dc[j],a[i][j]);
if(!~a[i][j])x=i,y=j;
}
for(int i=1;i<=n;i++)
for(int j=1;j<=n;j++)
a[i][j]-=((~dl[i])?dl[i]:0)+((~dc[i])?dc[i]:0);
cout<<max(a[x-1][y],a[x+1][y])+max(a[x][y-1],a[x][y+1]);
return 0;
}
詳細信息
Test #1:
score: 100
Accepted
time: 1ms
memory: 3668kb
input:
3 1 2 1 0 -1 0 0 1 0
output:
1
result:
ok 1 number(s): "1"
Test #2:
score: -100
Wrong Answer
time: 0ms
memory: 3612kb
input:
10 63 66 64 39 41 64 67 46 45 56 67 70 68 43 45 68 71 50 49 60 72 75 73 48 50 73 76 55 54 65 64 67 65 40 42 65 68 47 46 57 81 84 82 57 59 82 85 64 63 74 43 46 44 19 21 44 47 26 25 36 45 48 46 21 23 -1 49 28 27 38 70 73 71 46 48 71 74 53 52 63 57 60 58 33 35 58 61 40 39 50 81 84 82 57 59 82 85 64 63 74
output:
27
result:
wrong answer 1st numbers differ - expected: '46', found: '27'