Submission #00001
ソースコード
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 34 35 | #include<bits/stdc++.h> #define F first #define S second #define endl '\n' #define MP make_pair #define pb push_back using namespace std; typedef pair< int , int > P; typedef pair< int , P> i_P; typedef long long LL; static const int INF = INT_MAX; static const int MIN = INT_MIN; static const LL L_INF = LLONG_MAX; static const int MOD = 1000000000 + 7; static const int SIZE = 100005; int main() { cin.tie(0); ios::sync_with_stdio( false ); int n; cin >> n; int cnt = 0; while ( n > 0 ) { if ( n % 2 ) ++cnt; n /= 2; } cout << cnt << endl; return 0; } |
ステータス
項目 | データ |
---|---|
問題 | 0001 - こんなの一瞬だろ |
ユーザー名 | crom |
投稿日時 | 2019-04-23 18:33:46 |
言語 | C++11 |
状態 | Accepted |
得点 | 100 |
ソースコード長 | 641 Byte |
最大実行時間 | 33 ms |
最大メモリ使用量 | 664 KB |
セット
セット | 得点 | Cases | |
---|---|---|---|
1 | ALL | 100 / 100 | * |
テストケース
ファイル名 | 状態 | 実行時間 | メモリ使用量 | # |
---|---|---|---|---|
input-sample1 | AC | 33 ms | 476 KB |
1
|
input-sample2 | AC | 20 ms | 428 KB |
1
|
input01 | AC | 15 ms | 508 KB |
1
|
input02 | AC | 19 ms | 464 KB |
1
|
input03 | AC | 20 ms | 420 KB |
1
|
input04 | AC | 26 ms | 504 KB |
1
|
input05 | AC | 23 ms | 588 KB |
1
|
input06 | AC | 18 ms | 540 KB |
1
|
input07 | AC | 17 ms | 492 KB |
1
|
input08 | AC | 19 ms | 572 KB |
1
|
input09 | AC | 27 ms | 532 KB |
1
|
input10 | AC | 14 ms | 616 KB |
1
|
input11 | AC | 25 ms | 576 KB |
1
|
input12 | AC | 19 ms | 532 KB |
1
|
input13 | AC | 24 ms | 492 KB |
1
|
input14 | AC | 18 ms | 576 KB |
1
|
input15 | AC | 23 ms | 664 KB |
1
|