QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#519128 | #7757. Palm Island | LuCiiiD# | WA | 0ms | 3692kb | C++23 | 1.3kb | 2024-08-14 16:29:27 | 2024-08-14 16:29:29 |
Judging History
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)