mirror of
https://github.com/wczffl-503/OI-Codes.git
synced 2025-07-07 18:06:58 +08:00
Upload ABC400 codes
This commit is contained in:
41
AtCoder/ABC_400/C.cpp
Normal file
41
AtCoder/ABC_400/C.cpp
Normal file
@ -0,0 +1,41 @@
|
||||
#include <bits/stdc++.h>
|
||||
#define lo long long
|
||||
#define INF INT_MAX
|
||||
#define LLM LONG_LONG_MAX
|
||||
#define endl "\n"
|
||||
|
||||
using namespace std;
|
||||
/*
|
||||
toothless. #17
|
||||
@fredcss_dev
|
||||
*/
|
||||
|
||||
|
||||
signed main() {
|
||||
int N;
|
||||
cin >> N;
|
||||
|
||||
int cnt = 0;
|
||||
int mx = 0;
|
||||
int current = 1;
|
||||
|
||||
while (current <= N) {
|
||||
current *= 2;
|
||||
mx++;
|
||||
}
|
||||
mx--;
|
||||
|
||||
for (int e = 1; e <= mx; ++e) {
|
||||
int m = N / (1 << e);
|
||||
if (m < 1) {
|
||||
continue;
|
||||
}
|
||||
int mx2 = sqrt(m);
|
||||
int cnt = (mx2 + 1) / 2;
|
||||
cnt += cnt;
|
||||
}
|
||||
|
||||
cout << cnt << endl;
|
||||
|
||||
return 0;
|
||||
}
|
Reference in New Issue
Block a user