-
-
Save niklasjang/9279831bc1419cdd16b9ecb73598c249 to your computer and use it in GitHub Desktop.
[PS][java][Brute-Force]/[토너먼트]
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import javax.sound.midi.SysexMessage; | |
import java.io.BufferedReader; | |
import java.io.IOException; | |
import java.io.InputStreamReader; | |
import java.util.*; | |
public class Main{ | |
static int n,a,b; | |
public static void main(String[] args) throws IOException { | |
BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); | |
StringTokenizer st = new StringTokenizer(br.readLine()); | |
n = Integer.parseInt(st.nextToken()); | |
a = Integer.parseInt(st.nextToken()); | |
b = Integer.parseInt(st.nextToken()); | |
int ans = 0; | |
while(a!=b){ | |
a -= a/2; | |
b -= b/2; | |
ans++; | |
} | |
System.out.println(ans); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment