• 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;
    }


  • 相关阅读:
    简单的sql注入3
    简单的sql注入2
    简单的sql注入1
    python安装request及更新pip
    kali linux上安装ssh
    看起来有点难
    猫抓老鼠
    头有点大
    貌似有点难
    这个看起来有点简单!
  • 原文地址:https://www.cnblogs.com/mofushaohua/p/7789481.html
Copyright © 2020-2023  润新知