飞步无人驾驶2018届校园招聘在线笔试A轮 register

Ended

Participants:152

Verdict:Accepted
Score:100 / 100
Submitted:2018-10-06 19:07:14

Lang:G++

Edit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include<bits/stdc++.h>
#define maxs 8
using namespace std;
int n;
int st,c,cost[maxs];
char s[maxs];
void init()
{
    memset(cost,0x3f,sizeof(cost));
    scanf("%d",&n);
    for (int i=1;i<=n;++i)
    {
        scanf("%d%s",&c,s);
        st=0;
        for (int i=0;s[i];++i)
            st|=1<<(s[i]-'A');
//      cout<<st<<" "<<c<<endl;
        cost[st]=min(cost[st],c);
    }
}
void solve()
{
    cost[0]=0;
    for (int s=1;s<8;++s)
    {
        for (int t=0;t<8;++t)
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX