Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

Re:虽然还不会做,但这么明显的博弈题怎么网上所有的分类都说是几何题,再也不信网上的分类了

Posted by Los_Angelos_Laycurse at 2012-12-16 23:37:55 on Problem 2315
In Reply To:Re:虽然还不会做,但这么明显的博弈题怎么网上所有的分类都说是几何题,再也不信网上的分类了 Posted by:JiaJunpeng at 2012-12-16 23:36:10
> 猜了个结论G++过了,但C++WA,以下是代码,不知道为神马
> Source Code
> 
> Problem: 2315  User: JiaJunpeng 
> Memory: 700K  Time: 0MS 
> Language: G++  Result: Accepted 
> 
> Source Code 
> #include<iostream>
> #include<stdio.h>
> #include<algorithm>
> #include<cmath>
> #include<cstdlib>
> #include<cstring>
> #include<string>
> #include<vector>
> using namespace std;
> int n,m,l,r,c[33],k;
> double dist,pi=acos(-1.00),now,eps=1e-9;
> int main()
> {
>     int i,j,s,p,q;
>     while(scanf("%d%d%d%d",&n,&m,&l,&r)==4)
>     {
>        k=(int)((double)(l+eps)/(2*pi*r));
>        for(i=0;i<n;i++)
>        {
>           scanf("%lf",&dist);
>           c[i]=(int)((dist-eps)/(2*pi*r))+1;
>           c[i]%=k+1;
>        }
>        for(i=0;i<31;i++)
>        {
>           int value=0;
>           for(j=0;j<n;j++)
>           {
>               if(c[j]&(1<<i))
>                 value++;
>           }  
>           if(value%(m+1)!=0) 
>              break;
>        }
>        if(i<31)
>           puts("Alice");
>        else
>           puts("Bob");
>     }
>     return 0;
> }
> 
不要理我,没看到是多组数据读入,55555

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator