QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#534589 | #7075. Let's Play Jigsaw Puzzles! | xiojoy# | WA | 1ms | 5752kb | C++20 | 767b | 2024-08-27 14:14:02 | 2024-08-27 14:14:02 |
Judging History
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 '