求助!迷之RE

P1201 [USACO1.1] 贪婪的送礼者Greedy Gift Givers

@[Mr_Stardust](/space/show?uid=143841) ~~东方盈利有可能,管理被害有可能。~~ 数组越界有可能,RE多数都是数组越界?
by Bean233 @ 2019-03-05 12:55:06


en...反正我和你一样 只是代码不一样 @[AThinker](/space/show?uid=175149) map也会越界吗(~~不会吧~~) ```cpp #include<iostream> #include<map> using namespace std; map <string,int> mp; int main() { int n,i,j,give,gipe; string s,k,a[15]; cin>>n; for(i=1;i<=n;i++) cin>>a[i]; for(i=1;i<=n;i++) { cin>>k>>give>>gipe; for(j=1;j<=gipe;j++) { cin>>s; mp[s]+=int(give/gipe); } mp[k]+=(give%gipe); mp[k]-=give; } for(i=1;i<=n;i++) cout<<a[i]<<" "<<mp[a[i]]<<endl; return 0; } ```
by 小罐猹 @ 2019-03-11 20:41:42


妈耶我也是
by CuO同学 @ 2019-07-12 16:23:56


@[lingxiaoyu](/space/show?uid=93851) @[Yang____](/space/show?uid=183743) @[Mr_Stardust](/space/show?uid=143841) 除以了**0**!
by xyf007 @ 2019-08-03 11:56:39


@[xyf007](/space/show?uid=68273) 的确如此,我改过来了 不过这已经是半年前的事了……
by Star1_3st @ 2019-08-03 12:34:32


|