QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#395366 | #7075. Let's Play Jigsaw Puzzles! | suibian_xiaozhao# | WA | 0ms | 3652kb | C++23 | 572b | 2024-04-21 13:47:43 | 2024-04-21 13:47:43 |
Judging History
answer
//
// Created by DELLPC on 24-4-21.
//
#include<bits/stdc++.h>
using namespace std;
int main() {
int m;
cin >> m;
vector<int> n(m * m + 1, -1), s(m * m + 1, -1), w(m * m + 1, -1), e(m * m + 1, -1);
int st;
for(int i = 1; i <= m * m; i++) {
cin >> n[i] >> s[i] >> w[i] >> e[i];
if(n[i] == -1 && w[i] == -1) {
st = i;
}
}
for(int i = st; i != -1; i = s[i]) {
for(int j = i; j != -1; j = e[j]) {
cout << j << ' ';
}
cout <<endl;
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3652kb
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 '