PersonalCorpus 版 (精华区)
1228407 Big Guava ... 10404 Accepted
0:03.139 1372 2002/11/11 02:08:11.609
void main()
{
#ifndef ONLINE_JUDGE
freopen("k:\\iB","r",stdin);
freopen("k:\\oB","w",stdout);
#endif
int i,j,k,m,n,c[10];
bool mark [1000010];
while (scanf("%d",&n)==1) {
scanf("%d",&m);
for (i=0;i<m;i++) scanf("%d",&c[i]);
memset(mark,0,sizeof(mark));
for (i=0;i<n;i++) if (!mark[i])
for (j=0;j<m;j++) {
k=c[j]+i;
if (k<=n) mark[k]=true;
}
if (mark[n]) printf("Stan wins\n");
else printf("Ollie wins\n");
}
}
Powered by KBS BBS 2.0 (http://dev.kcn.cn)
页面执行时间:2.903毫秒