求助,第四个点过不去!

P1603 斯诺登的密码

###第四个点过不去!
by HygoK67 @ 2017-12-04 21:45:24


#求第四个点数据
by HygoK67 @ 2017-12-05 11:33:02


one two three four five six .
by 望天树 @ 2018-01-22 13:04:10


10409162536
by 望天树 @ 2018-01-22 13:04:21


```cpp #include<cstdio> #include<cstring> #include<string> #include<algorithm> #include<iostream> using namespace std; struct gg{ string s; int k; }f[26]; int top=0; string b[20],res[20]; inline int read() { int t=1,data=0; char ch=0; while(ch!='-'&&!isdigit(ch)) ch=getchar(); if(ch=='-') t=-1,ch=getchar(); while(isdigit(ch)) data=data*10+ch-48; return data*t; } inline void pre() { for(int i=1;i<=20;i++) f[i].k=i; f[1].s="one"; f[2].s="two"; f[3].s="three"; f[4].s="four"; f[5].s="five"; f[6].s="six"; f[7].s="seven"; f[8].s="eight"; f[9].s="nine"; f[10].s="ten"; f[11].s="eleven"; f[12].s="twelve"; f[13].s="thirteen"; f[14].s="fourteen"; f[15].s="fifteen"; f[16].s="sixteen"; f[17].s="seventeen"; f[18].s="eighteen"; f[19].s="nineteen"; f[20].s="twenty"; f[0].k=1; f[0].s="a"; f[21].k=2; f[21].s="both"; f[22].k=1; f[22].s="another"; f[23].k=1; f[23].s="first"; f[24].k=2; f[24].s="second"; f[25].k=3; f[25].s="third"; } inline string turn(int k) { string s; int lwd=k*k%100; s.push_back(lwd/10+'0'); s.push_back(lwd%10+'0'); return s; } inline bool cmp(string a,string b) { return a+b<b+a; } int main() { ios::sync_with_stdio(false); long long ans=0; char ch; for(int i=0;i<6;i++) cin>>b[i]; // ch=getchar(); pre(); for(int i=0;i<6;i++) for(int j=0;j<26;j++) if(b[i]==f[j].s) res[++top]=turn(f[j].k); sort(res+1,res+1+top,cmp); for(int i=1;i<=top;i++) ans=ans*100+(res[i][0]-'0')*10+(res[i][1]-'0'); printf("%lld",ans); return 0; } ``` stm爆int。。。
by Explorer_CYC @ 2018-02-20 20:53:14


@[战术目镜](/space/show?uid=67178) 你的another好像拼错了。。
by Haishu @ 2018-03-03 16:33:59


我也醉醉的,站了半天没有找到错误。 结果原来是int不够大, 我是把每个数*100再累加的。改成long就好了。 给测试数据的都是好人啊 ==
by doingforemmmm @ 2018-07-22 00:44:57


是不是爆了
by cp1227 @ 2021-10-04 08:48:19


|