QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#331479#7042. So EasynickolessWA 0ms3624kbC++14978b2024-02-18 11:39:392024-02-18 11:39:41

Judging History

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

  • [2024-02-18 11:39:41]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3624kb
  • [2024-02-18 11:39:39]
  • 提交

answer

#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
const int maxn=1005;
const int inf=2e9;

int n,a[maxn][maxn];
int x,y,tx,ty;

int main(){
	cin>>n;
	int minn=inf;
	for(int i=1;i<=n;i++)
		for(int j=1;j<=n;j++){
			cin>>a[i][j];
			if(!~a[i][j])x=i,y=j;
			else if(a[i][j]<minn){
				minn=a[i][j];
				tx=i;
				ty=j;
			}
		}
	for(int i=1;i<=n;i++){
		if(i==tx)continue;
		for(int j=1;j<=n;j++){
			a[i][j]-=a[tx][j];
		}
	}
	
	for(int j=1;j<=n;j++){
		if(j==ty)continue;
		for(int i=1;i<=n;i++){
			if(i==tx)continue;
			a[i][j]-=a[i][ty];
		}
	}
	
	cout<<-a[x][y]-1;
	
	return 0;
} 
/*
10
63 66 64 39 41 -1 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 46 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

*/

詳細信息

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3624kb

input:

3
1 2 1
0 -1 0
0 1 0

output:

0

result:

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