Submission #2374363


Source Code Expand

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long a = sc.nextLong();
		long b = sc.nextLong();
		long c = sc.nextLong();
		if(a == b && b == c) {
          if(a%2==0) System.out.println(-1);
          if(a%2==1) System.out.println(0);
			return;
		}
		int ans = 0;
		while(a % 2 == 0 && b % 2 == 0 && c % 2 == 0) {
			ans++;
			long x = a / 2 + b / 2;
			long y = b / 2 + c / 2;
			long z = c / 2 + a / 2;
			a = y;
			b = z;
			c = x;
		}
		System.out.println(ans);
	}
}

Submission Info

Submission Time
Task A - Cookie Exchanges
User tempura0224
Language Java8 (OpenJDK 1.8.0)
Score 300
Code Size 583 Byte
Status AC
Exec Time 95 ms
Memory 23124 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
AC × 3
AC × 17
Set Name Test Cases
Sample sample1.txt, sample2.txt, sample3.txt
All sample1.txt, sample2.txt, sample3.txt, in1.txt, in10.txt, in11.txt, in2.txt, in3.txt, in4.txt, in5.txt, in6.txt, in7.txt, in8.txt, in9.txt, sample1.txt, sample2.txt, sample3.txt
Case Name Status Exec Time Memory
in1.txt AC 93 ms 21204 KB
in10.txt AC 95 ms 19540 KB
in11.txt AC 94 ms 23124 KB
in2.txt AC 91 ms 19924 KB
in3.txt AC 94 ms 16980 KB
in4.txt AC 93 ms 19924 KB
in5.txt AC 93 ms 18772 KB
in6.txt AC 93 ms 21844 KB
in7.txt AC 93 ms 18644 KB
in8.txt AC 92 ms 19924 KB
in9.txt AC 93 ms 19668 KB
sample1.txt AC 92 ms 19540 KB
sample2.txt AC 91 ms 19668 KB
sample3.txt AC 92 ms 18772 KB