题目:
看起来很复杂,其实就是有多少个素因子就翻转多少次。
然后考虑到只有平方数有奇数个素因子。
一次过,上代码把:
#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 2147483647 int main(){
ll n;
cin >> n;
ll p = sqrt(n);
cout << n-p << endl;
return ;
}