QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#534899 | #7075. Let's Play Jigsaw Puzzles! | xiojoy# | WA | 1ms | 5628kb | C++20 | 755b | 2024-08-27 17:17:42 | 2024-08-27 17:17:42 |
Judging History
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';
}
}
Details
Tip: Click on the bar to expand more detailed information
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 '