51nod 1717 好数 (水题)
生活随笔
收集整理的這篇文章主要介紹了
51nod 1717 好数 (水题)
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
題目:
看起來很復(fù)雜,其實(shí)就是有多少個素因子就翻轉(zhuǎn)多少次。
然后考慮到只有平方數(shù)有奇數(shù)個素因子。
一次過,上代碼把:
#include <iostream> #include <algorithm> #include <map> #include <vector> #include <set> #include <math.h> #include <queue> #include <assert.h> #include <stdio.h> #include <stdlib.h> #include <string> using namespace std; typedef long long ll; #define INF 2147483647int main(){ll n;cin >> n;ll p = sqrt(n);cout << n-p << endl;return 0; }總結(jié)
以上是生活随笔為你收集整理的51nod 1717 好数 (水题)的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 51nod 1448 二染色问题 (逆
- 下一篇: vmware workstation p