Submission #1468961


Source Code Expand

#include <stdio.h>

int main(void)
{
	int n;
	int i, j;
	int count = 0;
	int max = 0;
	int max_n = 0;
	
	scanf("%d", &n);
	
	
	
	for (i = 1; i <= n; i++){
		if (n == 1){
			max_n = 1;
			break;
		}
		j = i;
		while (j % 2 == 0){
			j = j / 2;
			count++;
		}
		if (count > max){
			max = count;
			max_n = i;
		}
		count = 0;
	}
	
	printf("%d\n", max_n);
	
	return (0);
}

Submission Info

Submission Time
Task B - Break Number
User misterjune
Language C (GCC 5.4.1)
Score 200
Code Size 405 Byte
Status AC
Exec Time 1 ms
Memory 128 KiB

Compile Error

./Main.c: In function ‘main’:
./Main.c:11:2: warning: ignoring return value of ‘scanf’, 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 KiB
example1 AC 1 ms 128 KiB
example2 AC 1 ms 128 KiB
example3 AC 1 ms 128 KiB
handmade0 AC 1 ms 128 KiB
handmade1 AC 1 ms 128 KiB
handmade2 AC 1 ms 128 KiB
rand0 AC 1 ms 128 KiB
rand1 AC 1 ms 128 KiB
rand2 AC 1 ms 128 KiB
rand3 AC 1 ms 128 KiB
rand4 AC 1 ms 128 KiB
rand5 AC 1 ms 128 KiB
rand6 AC 1 ms 128 KiB
rand7 AC 1 ms 128 KiB
rand8 AC 1 ms 128 KiB
rand9 AC 1 ms 128 KiB