QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#534899#7075. Let's Play Jigsaw Puzzles!xiojoy#WA 1ms5628kbC++20755b2024-08-27 17:17:422024-08-27 17:17:42

Judging History

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

  • [2024-08-27 17:17:42]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:5628kb
  • [2024-08-27 17:17:42]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
const int N = 1e6+10;
const int M = 1e3+10;
struct node{
	int n, s, w, e;
}; node z[N];
int a[M][M];
int main()
{
    int m, flag;
    cin >> m;
    for(int i = 1; i <= m * m; ++i){
    	cin >> z[i].n >> z[i].s >> z[i].w >> z[i].e;
    	if(z[i].w == -1 && z[i].n == -1){
    		flag = i;
    		//cout <<"!"<<endl;
		}
	}
	//cout << flag << endl;
	a[0][0] = flag;
	for(int i = 1; i < m; ++i){
		a[0][i] = z[a[0][i - 1]].e;
		//cout << a[0][i]<<" ";
	}
	//cout << endl;
	for(int i = 1; i < m; ++i){
		for(int j = 0; j < m; ++j){
			a[i][j] = z[a[i - 1][j]].s;
		}
	}
	for(int i = 0; i < m; ++i){
		for(int j = 0; j < m; ++j){
			cout << a[i][j] <<" ";
		}
		cout << '\n';
	}
}

详细

Test #1:

score: 0
Wrong Answer
time: 1ms
memory: 5628kb

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 '