QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#693021#7075. Let's Play Jigsaw Puzzles!ucup-team4352#WA 2ms11904kbC++23584b2024-10-31 15:23:212024-10-31 15:23:27

Judging History

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

  • [2024-10-31 15:23:27]
  • 评测
  • 测评结果:WA
  • 用时:2ms
  • 内存:11904kb
  • [2024-10-31 15:23:21]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
const int maxn=1e6+5;
int m,n[maxn],s[maxn],w[maxn],e[maxn];
int ans[1005][1005];
int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	cin>>m;
	int p=0;
	for(int i=1;i<=m*m;++i) {
		cin>>n[i]>>s[i]>>w[i]>>e[i];
		if(n[i]==-1&&w[i]==-1) p=i;
	}
	ans[1][1]=p;
	for(int i=1;i<=m;++i) {
		for(int j=1;j<=m;++j) {
			int p=ans[i][j];
			if(s[p]!=-1) ans[i+1][j]=s[p];
			if(e[p]!=-1) ans[i][j+1]=e[p];
			cout<<ans[i][j]<<' ';
		}
		cout<<'\n';
	}
	return 0;
}/*
 2
 -1 3 -1 2
 -1 4 1 -1
 1 -1 -1 4
 2 -1 3 -1
*/

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 2ms
memory: 11904kb

input:

2
-1 3 -1 2
-1 4 1 -1
1 -1 -1 4
2 -1 3 -1

output:

1 2 
3 4 

result:

wrong answer 1st lines differ - expected: '1 2', found: '1 2 '