Submission #48652


ソースコード

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
//#include<bits/stdc++.h>
#include <iostream>
#include <cstdio>
#include <cstring>
#include <string>
#include <vector>
#include <queue>
#include <map>
#include <algorithm>
#include <utility>
#include <climits>
#define REP(i, n) for(int i = 0; i < n; ++i)
#define FOR(i, a, b) for(int i = a; i < b; ++i)
#define F first
#define S second
#define OUT(x) cout << x << "\n"
using namespace std;
using point = pair< int,int >;
using ll = long long;
int main() {
int n;
cin >> n;
int cnt = 0;
while (n > 0) {
cnt += n & 1;
n = n >> 1;
}
OUT(cnt);
return 0;
}

ステータス

項目 データ
問題 1123 - こんなの一瞬だろ
ユーザー名 Wonder /*ei1741*/
投稿日時 2019-04-24 15:58:03
言語 C++14
状態 Accepted
得点 1
ソースコード長 634 Byte
最大実行時間 27 ms
最大メモリ使用量 644 KB

セット

セット 得点 Cases
1 ALL 1 / 1 *

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
input-sample1 AC 19 ms 476 KB
1
input-sample2 AC 19 ms 580 KB
1
input01 AC 15 ms 544 KB
1
input02 AC 23 ms 384 KB
1
input03 AC 20 ms 484 KB
1
input04 AC 23 ms 448 KB
1
input05 AC 22 ms 544 KB
1
input06 AC 21 ms 644 KB
1
input07 AC 27 ms 488 KB
1
input08 AC 21 ms 464 KB
1
input09 AC 22 ms 440 KB
1
input10 AC 16 ms 416 KB
1
input11 AC 21 ms 516 KB
1
input12 AC 18 ms 492 KB
1
input13 AC 18 ms 600 KB
1
input14 AC 21 ms 568 KB
1
input15 AC 22 ms 544 KB
1