Submission #2374395


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(), sc.nextLong(), sc.nextLong()};
		int ans = 0;
		for(int i = 0 ; i < 1000 ; i++) {
			for(int j = 0 ; j < 3 ; j++) {
				if(a[j] % 2 == 1) {
					System.out.println(i);
					return;
				}
			}
			long x = (a[0] + a[1]) / 2;
			long y = (a[1] + a[2]) / 2;
			long z = (a[2] + a[0]) / 2;
			a[0] = y;
			a[1] = z;
			a[2] = x;
		}
		System.out.println(-1);
	}
}

Submission Info

Submission Time
Task A - Cookie Exchanges
User kouta1612
Language Java8 (OpenJDK 1.8.0)
Score 300
Code Size 540 Byte
Status AC
Exec Time 93 ms
Memory 23764 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 92 ms 18900 KB
in10.txt AC 90 ms 21844 KB
in11.txt AC 93 ms 20692 KB
in2.txt AC 91 ms 21972 KB
in3.txt AC 92 ms 16976 KB
in4.txt AC 91 ms 19796 KB
in5.txt AC 93 ms 21332 KB
in6.txt AC 91 ms 21844 KB
in7.txt AC 92 ms 19156 KB
in8.txt AC 92 ms 18644 KB
in9.txt AC 92 ms 21844 KB
sample1.txt AC 92 ms 19924 KB
sample2.txt AC 92 ms 23764 KB
sample3.txt AC 93 ms 20948 KB