QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#469249 | #4786. Balance | PlentyOfPenalty | WA | 0ms | 3880kb | C++17 | 601b | 2024-07-09 16:43:24 | 2024-07-09 16:43:24 |
Judging History
answer
#include<bits/stdc++.h>
typedef long long ll;
void umax(ll& a,ll t)
{
if(t>a)a=t;
}
const int MAXN = 1011;
ll a[MAXN][MAXN];
int main()
{
int n;
scanf("%d",&n);
for(int i=1;i<=n;++i)
for(int j=1;j<=n;++j)
scanf("%lld",&a[i][j]);
for(int i=2;i<=n;++i)
{
ll delta=a[i][1]-a[i-1][1];
for(int j=2;j<=n;++j)umax(delta,a[i][j]-a[i-1][j]);
for(int j=1;j<=n;++j)a[i][j]=a[i-1][j]+delta;
}
for(int i=1;i<=n;++i)
for(int j=1;j<=n;++j)
printf("%lld%c",a[i][j],j==n?'\n':' ');
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3880kb
input:
4 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1
output:
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
result:
wrong output format Unexpected end of file - int32 expected