QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#395366#7075. Let's Play Jigsaw Puzzles!suibian_xiaozhao#WA 0ms3652kbC++23572b2024-04-21 13:47:432024-04-21 13:47:43

Judging History

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

  • [2024-04-21 13:47:43]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3652kb
  • [2024-04-21 13:47:43]
  • 提交

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 '