Submission #2374377


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) {
			System.out.println(-1);
			return;
		}
		if(a == 1 && b == 1 && c == 1) {
			System.out.println(0);
			return;
		}
		long 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 kouta1612
Language Java8 (OpenJDK 1.8.0)
Score 0
Code Size 601 Byte
Status WA
Exec Time 94 ms
Memory 21844 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 300
Status
AC × 3
AC × 16
WA × 1
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 21076 KB
in10.txt WA 91 ms 21844 KB
in11.txt AC 93 ms 19668 KB
in2.txt AC 94 ms 21204 KB
in3.txt AC 93 ms 20948 KB
in4.txt AC 91 ms 21844 KB
in5.txt AC 93 ms 17492 KB
in6.txt AC 93 ms 18900 KB
in7.txt AC 92 ms 18644 KB
in8.txt AC 91 ms 20820 KB
in9.txt AC 93 ms 21716 KB
sample1.txt AC 94 ms 19668 KB
sample2.txt AC 92 ms 19284 KB
sample3.txt AC 92 ms 19028 KB