結果

問題 No.1329 Square Sqsq
ユーザー Cyclone28
提出日時 2021-01-08 21:38:16
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 4 ms / 2,000 ms
コード長 326 bytes
コンパイル時間 1,461 ms
コンパイル使用メモリ 166,184 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-16 10:41:06
合計ジャッジ時間 2,189 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 24
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;

bool two(int n){
  if(n == 0) return false;
  while(n % 2 == 0){
    n /= 2;
  }
  return n == 1;
}

int main(){
  string s;
  cin >> s;
  if(s.size() == 1) cout << 1 << endl;
  else if(two(s.size()-1)) cout << (s.size()-1)/2 + 1 << endl;
  else cout << (s.size()+1)/2  << endl;
}
0