zoukankan      html  css  js  c++  java
  • UVA

    //本来想用数组,结果RE,后来发现只是需要判定最后一个,并不需要数组
    //可是,然后就,WA了...
    /*WA
    #include <iostream>
    #include <cstring>
    #include <cmath>
    using namespace std;
    typedef long long ll;
    int n;
    
    int main()
    {
    	while (cin >> n)
    	{
    		if (!n) break;
    		int ans = 0;
    		
    		for (int i = 1; i <= n; i++)
    		if (n % i == 0) ans = !ans;
    		
    		if (ans) cout << "yes" << endl;
    		else cout << "no" << endl;
    	}
    	return 0;
    }*/


    /*后来发现数据范围似乎不对,可是改为long long 以后,就TLE了...心痛!!!
    #include <iostream>
    #include <cstring>
    #include <cmath>
    using namespace std;
    typedef long long ll;
    ll n;
    
    int main()
    {
    	while (cin >> n)
    	{
    		if (!n) break;
    		int ans = 0;
    		
    		for (ll i = 1; i <= n; i++)
    		if (n % i == 0) ans = !ans;
    		
    		if (ans) cout << "yes" << endl;
    		else cout << "no" << endl;
    	}
    	return 0;
    }*/

    /*
      最后才发觉,这题其实是数论题,不能用蛮劲,必须得巧做啊!
      以及很清楚的解析:
      http://blog.csdn.net/metaphysis/article/details/6535147
    */

    #include <iostream>
    #include <cstring>
    #include <cmath>
    using namespace std;
    typedef long long ll;
    ll n;
    
    int main()
    {
    	while (cin >> n)
    	{
    		if (!n) break;
    		int ans = 0;
    		
    		ll t = sqrt(n);
    		if (t * t == n) ans = 1;
    		
    		if (ans) cout << "yes" << endl;
    		else cout << "no" << endl;
    	}
    	return 0;
    }


  • 相关阅读:
    Druid数据库密码加密
    jenkins 构建时不能自动结束的问题
    4、TypeScript 类
    3、TypeScript 函数
    2、Typescript 中的数据类型
    1、TypeScript安装、开发工具
    Markdown 基本格式
    解决邮箱下载下来的word打不开的问题
    winform在禁用控件上显示工具提示
    日常问题集
  • 原文地址:https://www.cnblogs.com/mofushaohua/p/7789481.html
Copyright © 2011-2022 走看看