HUST Online Judge WebBoard
Problem 1393 >> 加了快读咋t了,难道是我代码丑。。QAQ
56456456 @ 2018-10-30 21:19:03
[ Quote ] [ Edit ] [ Delete ] 1#
#include <unordered_map>
#include <algorithm>
#include <iostream>
#include <string.h>
#include <stdio.h>
#include <string>
#include <bitset>
#include <math.h>
#include <queue>
#include <stack>
#include <list>
#include <set>
using namespace std;

#define eps (1e-6)
#define ll long long
#define pi acos(-1.0)
#define INF 0x3f3f3f3f
#define rd(a) (a = read())
#define mem(a,b) memset(a,b,sizeof(a))

inline int read()
{
char ch = getchar();
int x = 0, f = 1;
while(ch < '0' || ch > '9') {if(ch == '-') f = -1; ch = getchar();}
while('0' <= ch && ch <= '9') x = x*10 + ch - '0', ch = getchar();
return x*f;
}

int v[200005];

int main()
{
int n = read(), ma = 0, a;
for(int i = 1; i <= n; ++i) v[read()] = i;
int k = read();
while(k--)
{
rd(a);
if(v[a] > ma)
{
printf("%d ",v[a]-ma);
ma = v[a];
}
else printf("0 ");
}
printf("\n%s\n",ma == n ? "yes" : "no");
return 0;
}