Created
November 21, 2012 13:58
-
-
Save Wizmann/4124979 to your computer and use it in GitHub Desktop.
Codeforces Round #149 (Div. 2) (B)
This file contains hidden or 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 java.util.Scanner | |
object Main extends App | |
{ | |
val cin=new Scanner(System.in) | |
val n=cin.nextInt() | |
val seg=(1<<30,0) :: List.tabulate(n)(_=>(cin.nextInt,cin.nextInt)) | |
val s=seg.reduce((a,b) => (math.min(a._1,b._1),math.max(a._2,b._2))) | |
println(seg.indexOf(s)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment