QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#519262 | #7757. Palm Island | LuCiiiD# | WA | 2ms | 11448kb | C++23 | 1.3kb | 2024-08-14 18:00:14 | 2024-08-14 18:00:15 |
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 1000005
using namespace std;
int T, N, b, a, book[MAX];
vector<int> arr;
void init(void)
{
for (int i = 0; i < MAX; i++)
book[i] = 0;
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: 2ms
memory: 11448kb
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)