Submission #1865284


Source Code Expand

#include <cstdio>
#include <algorithm>
#define REP(i, n) for(int i = 0; i < (int)(n); ++i)
using namespace std;

typedef long long ll;


int main(void) {
  int n;
  scanf("%d", &n);
  int res = 1;
  int maxi = 0;
  for(int i = 1; i <= n; ++i) {
    int cur = 0;
    int tmp = i;
    while(tmp % 2 == 0) {
      cur++;
      tmp /= 2;
    }
    if(cur > maxi) {
      maxi = cur;
      res = i;
    }
  }
  printf("%d\n", res);
  return 0;
}

Submission Info

Submission Time
Task B - Break Number
User ush
Language C++14 (GCC 5.4.1)
Score 200
Code Size 471 Byte
Status AC
Exec Time 1 ms
Memory 128 KB

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:12:18: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d", &n);
                  ^

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 4
AC × 17
Set Name Test Cases
Sample example0, example1, example2, example3
All example0, example1, example2, example3, handmade0, handmade1, handmade2, rand0, rand1, rand2, rand3, rand4, rand5, rand6, rand7, rand8, rand9
Case Name Status Exec Time Memory
example0 AC 1 ms 128 KB
example1 AC 1 ms 128 KB
example2 AC 1 ms 128 KB
example3 AC 1 ms 128 KB
handmade0 AC 1 ms 128 KB
handmade1 AC 1 ms 128 KB
handmade2 AC 1 ms 128 KB
rand0 AC 1 ms 128 KB
rand1 AC 1 ms 128 KB
rand2 AC 1 ms 128 KB
rand3 AC 1 ms 128 KB
rand4 AC 1 ms 128 KB
rand5 AC 1 ms 128 KB
rand6 AC 1 ms 128 KB
rand7 AC 1 ms 128 KB
rand8 AC 1 ms 128 KB
rand9 AC 1 ms 128 KB