第二十三行报错。
#include <bits/stdc++.h>
using namespace std;
int n;
map<string,pair<int,int> >xy;
vector<string>v;
map<string,double>dis;
map<string,int>m;
int main()
{
ios::sync_with_stdio(0);
cin>>n;
for(int t=1;t<=n;t++)
{
string op,str;
int x,y;
cin>>op;
if(op=="new")
{
string str,x,y;
cin>>str>>x>>y;
if(m[str]==0)
{
xy[str]=make_pair(x,y);
v.push_back(str);
dis[str]=0;
m[str]=1;
}
else
cout<<"Invaild Command"<<endl;
}
else if(op=="move")
{
cin>>str>>x>>y;
if(m[str]==0)
cout<<"Invild Command"<<endl;
else
dis[str]+=sqrt(abs(xy[str].first-x)*abs(xy[str].first-x)+abs(xy[str].second-y)*abs(xy[str].second-y));
}
else if(op=="del")
{
cin>>str;
if(m[str]==0)
cout<<"Invaild Command"<<endl;
else
m[str]=0;
}
else if(op=="querydis")
{
cin>>str;
if(m[str])
cout<<fixed<<setprecision(5)<<dis[str]<<endl;
else
cout<<"Invaild Command"<<endl;
}
else if(op=="list")
{
for(int i=0;i<v.size();i++)
if(m[v[i]])
cout<<v[i]<<endl;
}
else
cout<<"Hocus Pocus,Abrakadabra!Do you confirm that Santa Claus is real?"<<endl;
}
return 0;
}