hdu-2053

来源:互联网 发布:金风科技二期淘宝地址 编辑:程序博客网 时间:2024/06/05 06:27
Problem : 2053 ( Switch Game )     Judge Status : Accepted
RunId : 16317138    Language : G++    Author : qwezhaohaihong
Code Render Status : Rendered By HDOJ G++ Code Render Version 0.01 Beta
#include<iostream>#include<cstdio>using namespace std;int main(){     int n;     while(scanf("%d",&n)!=EOF)     {        int a[100002]={0};        int i,z,r;        for(i=1;i<=n;i++)        {                for(z=i,r=1;i*r<=n;r++)                {                        z=i*r;                        if(a[z]==0){a[z]=1;}                        else{a[z]=0;}                }        }        printf("%d\n",a[n]);     }   return 0;}
0 0
原创粉丝点击