QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#534589#7075. Let's Play Jigsaw Puzzles!xiojoy#WA 1ms5752kbC++20767b2024-08-27 14:14:022024-08-27 14:14:02

Judging History

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

  • [2024-08-27 14:14:02]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:5752kb
  • [2024-08-27 14:14:02]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
int n,m,q;
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: 5752kb

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 '