/ Vijos /

记录详情

Compile Error

/in/foo.cc:1:20: warning: extra tokens at end of #include directive
 #include <iostream>#include <cstdio>#include <algorithm>#include <cstring>#include <queue>#include <map>using namespace std;const int MAXN=100005;const int INF=(1<<30)-1;struct Edge{    int to,w,next;}e[MAXN<<1];int fisrt[MAXN];//Edgestruct node{    int cost,idx;    bool operator < (const node&b)const    {        return cost>b.cost;    }}sco[MAXN];int n,m,tot;map<string,int> Hash;int d[MAXN],in[MAXN];//SPFAstring ip[MAXN];int w[MAXN];inline void Add_Edge(int x,int y,int w){    e[++tot].to=y;  e[tot].w=w;    e[tot].next=fisrt[x];   fisrt[x]=tot;}void init(){    int k,tmp;    string a,b;    memset(fisrt,-1,sizeof(fisrt));    cin>>k;    for(int i=1;i<=k;i++)    {        cin>>a>>tmp;        if(Hash[a])            w[Hash[a]]+=tmp;        else        {            Hash[a]=++n;            ip[n]=a;            w[Hash[a]]=tmp;        }    }    cin>>k;    for(int i=1;i<=k;i++)    {        cin>>a>>b;        if(Hash[a]&&Hash[b])            Add_Edge(Hash[a],Hash[b],w[Hash[a]]+w[Hash[b]]),            Add_Edge(Hash[b],Hash[a],w[Hash[a]]+w[Hash[b]]);    }}int SPFA(int s){    queue<int> q;    for(int i=1;i<=n;i++)        d[i]=INF;    memset(in,0,sizeof(in));    d[s]=0; in[s]=1; q.push(s);     while(!q.empty())    {        int u=q.front();    q.pop();    in[u]=0;        for(int i=fisrt[u];i!=-1;i=e[i].next)        {            int& v=e[i].to; int& w=e[i].w;            if(d[v]>d[u]+w)            {                d[v]=d[u]+w;                if(!in[v])                    in[v]=1,q.push(v);            }        }    }    int ans=0;    for(int i=1;i<=n;i++)    {        if(d[i]==INF)            return -INF;        else            ans+=d[i];    }    return ans;}void out(){    cout<<"The ONLY truth is: it is you, ";    if(sco[1].cost==-INF||sco[1].cost==sco[2].cost)        cout<<"222.240.168.135"<<endl;    else        cout<<ip[sco[1].idx]<<endl;}int main(){    init();    for(int i=1;i<=n;i++)    {        sco[i].cost=SPFA(i);        sco[i].idx=i;    }    sort(sco+1,sco+n+1);    out();    return 0;}
                    ^
/usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/Scrt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
collect2: error: ld returned 1 exit status

信息

递交者
类型
递交
题目
P1184 CoVH之华丽的IP伪装
语言
C++
递交时间
2018-03-24 15:09:13
评测时间
2018-03-24 15:09:13
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes