QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#212609#7075. Let's Play Jigsaw Puzzles!DetachWA 0ms3592kbC++17947b2023-10-13 18:09:342023-10-13 18:09:35

Judging History

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

  • [2023-10-13 18:09:35]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3592kb
  • [2023-10-13 18:09:34]
  • 提交

answer

#include <bits/stdc++.h>

using namespace std;

using LL = long long;
using i128 = __int128_t;
using PII = pair<int, int>;

const LL LINF = 0x3f3f3f3f3f3f3f3f;
const int INF = 0x3f3f3f3f;

void solve()
{
    int n;
    cin >> n;

    int bg;
    vector<int> rt(n * n + 1), dw(n * n + 1);
    for(int i = 1; i <= n * n; i ++ )
    {
        bool ok = false;
        vector<int> dir(4);
        for(int j = 0; j < 4; j ++ ) cin >> dir[j];

        if(dir[0] == -1 and dir[2] == -1) bg = i;

        rt[i] = dir[3];
        dw[i] = dir[1];
    }

    int ni = bg;
    int cnt = 0;
    while(ni ^ -1)
    {
        int nj = ni;
        while(nj ^ -1)
        {
            cout << nj << ' ';
            nj = rt[nj];
            // cnt ++ ;
            // if(cnt > 100) return;
        }
        ni = dw[ni];
        cout << endl;
    }
}
 
int main()  
{
    int T;

    solve();

    return 0;
}

詳細信息

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3592kb

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 '