結果
問題 |
No.47 ポケットを叩くとビスケットが2倍
|
ユーザー |
![]() |
提出日時 | 2020-10-04 18:02:08 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 520 bytes |
コンパイル時間 | 1,630 ms |
コンパイル使用メモリ | 165,644 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-19 17:36:33 |
合計ジャッジ時間 | 2,527 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 13 WA * 8 |
ソースコード
#include <bits/stdc++.h> using namespace std; using ll=long long; using Graph=vector<vector<int>>; #define MOD 1000000007 /* srand((unsigned int)time(NULL)); for(int i=0;i<10;i++){ cout<<rand()%6+1<<" "; } */ /* clock_t start,end; start=clock(); end=clock(); double t=(double)(end-start)/CLOCKS_PER_SEC; t<2.9; */ int main(){ int N; cin>>N; int ans=0; if(N%2==1){ ans++; } N>>=1; int one=0; while(N>0){ if(N%2==1&&N!=1){ one=1; } ans+=1; N>>=1; } cout<<ans+one<<endl; }