QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#519074 | #7757. Palm Island | LuCiiiD# | WA | 0ms | 3648kb | C++23 | 1.1kb | 2024-08-14 15:59:43 | 2024-08-14 15:59:43 |
Judging History
answer
#include <bits/stdc++.h>
#include <iostream>
#include <map>
#include <set>
#include <fstream>
#include <queue>
#include <stack>
#include <vector>
#include <string>
#include <algorithm>
#include <iterator>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <bitset>
#define ll long long
#define endl '\n'
#define inf 0x3f3f3f3f3f3f3f3f
using namespace std;
const ll N = 1e6 + 10, mod = 1;
ll n, m, k,a[N], ans = 0, maxx = 0, sum = 0, sum2 = 0;
queue<int>q;
void solve()
{
cin>>n;
for(int i=1;i<=n;i++){
cin>>m;
a[m]=1;
}
for(int i=1;i<=n;i++){
cin>>m;
a[m]=i;
}
for(int i=1;i<=n;i++){
q.push(a[i]);
}
for(int i=1;i<=n;i++){
m=q.front();
q.pop();
for(int j=1;j<=n-i;j++){
k=q.front();
q.pop();
if(m<k){
q.push(k);
cout<<2;
}
else{
q.push(m);
m=k;
cout<<1;
}
}
for(int j=1;j<=i;j++){
cout<<1;
}
}
cout<<endl;
}
int main()
{
ios::sync_with_stdio(false),
cin.tie(0),
cout.tie(0);
int T = 1, hhyy;
cin >> T;
while (T--)
{
solve();
}
}
详细
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3648kb
input:
2 3 1 2 3 2 3 1 4 1 2 3 4 2 1 3 4
output:
121111111 1221221121111111
result:
wrong answer On Case#1: After your operations, a[1] = 1 but a[1] = 2. (test case 1)