你的数组没有初始化吧
by Luban @ 2019-07-05 10:44:39
加个memset试试?或者开全局变量
by Luban @ 2019-07-05 10:45:02
@[可爱小鲁班](/space/show?uid=113600) 要是直接memset F,G和K就全RE了。
by Happy_Dream @ 2019-07-05 10:50:39
直接停止工作
by Happy_Dream @ 2019-07-05 10:51:28
@[yisu](/space/show?uid=127707) 那就全局变量啊,开在main外面不就OK了?
by Luban @ 2019-07-05 11:10:55
@可爱小鲁班,还是全WA。
后来换了一种思路(样例也过了)
又都是全WA
```cpp
#include <iostream>
#include <cstring>
#include <queue>
using namespace std;
int main()
{
int n,x=0,y=0,z=0;
cin>>n;
string a,b;
queue <string> f;
queue <string> k;
queue <string> g;
for(int i=1;i<=n;i++)
{
cin>>a>>b;
if(b[0]=='U')
f.push(a);
if(b[0]=='S')
g.push(a);
if(b[0]=='D')
k.push(a);
}
while(!k.empty())
{
cout<<k.front()<<endl;
k.pop();
}
while(!g.empty())
{
cout<<g.front()<<endl;
g.pop();
}
while(!f.empty())
{
cout<<f.front()<<endl;
f.pop();
}
return 0;
}
by Happy_Dream @ 2019-07-05 16:31:26
@[yisu](/space/show?uid=127707)
你的思路是错误的,不能先down然后same最后up。
因为same必须是要排名不变,所以要先处理。
by 浮生南柯一梦 @ 2019-08-21 16:21:12
@[欢乐王国](/space/show?uid=52895) 谢谢
by Happy_Dream @ 2019-08-21 16:26:39