QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#519128#7757. Palm IslandLuCiiiD#WA 0ms3692kbC++231.3kb2024-08-14 16:29:272024-08-14 16:29:29

Judging History

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

  • [2024-08-14 16:29:29]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3692kb
  • [2024-08-14 16:29:27]
  • 提交

answer

#include <bits/stdc++.h>
#define _11037_ ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
#define endl '\n'
#define int long long
#define inf 4e18
#define MAX 1005
using namespace std;
int T, N, b, a, book[MAX];
vector<int> arr;
inline void init(void)
{
    arr.clear();
}
signed main()
{
    _11037_
    cin >> T;
    while (T--)
    {
        init();
        cin >> N;
        for (int i = 1; i <= N; i++)
            cin >> a, book[a] = i;
        for (int i = 1; i <= N; i++)
            cin >> b, arr.push_back(book[b]);
        for (int i = 0; i < N - 1; i++)
        {
            for (int j = i; j < N - 1; j++)
            {
                if (arr[0] > arr[1])
                    arr.push_back(arr[0]), arr.erase(arr.begin()), cout << "1";
                else
                    arr.push_back(arr[1]), arr.erase(arr.begin() + 1), cout << "2";
            }
            for (int j = 0; j < i; j++)
                arr.push_back(arr[1]), arr.erase(arr.begin() + 1), cout << "2";
            arr.push_back(arr[0]), arr.erase(arr.begin()), cout << "1";
        }
        arr.push_back(arr[0]), arr.erase(arr.begin()), cout << "1";
        /* cout << endl;
        for (int i = 0; i < N; i++)
            cout << arr[i]; */
        cout << endl;
    }
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

2
3
1 2 3
2 3 1
4
1 2 3 4
2 1 3 4

output:

2111211
1221222122211

result:

wrong answer On Case#1: After your operations, a[1] = 3 but a[1] = 2. (test case 1)