Created
April 17, 2015 13:32
-
-
Save TPAKC/271fd875efc127986054 to your computer and use it in GitHub Desktop.
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 java.util.Date; | |
import java.util.Scanner; | |
import java.util.TreeSet; | |
/** | |
* Created by ТРАКС on 17.04.15. | |
*/ | |
public class Leks_Poryadok { | |
public static void main(String[] args) throws InterruptedException { | |
Scanner in = new Scanner(System.in); | |
TreeSet<String> set = new TreeSet<String>(); | |
int n = in.nextInt(); | |
int k = in.nextInt(); | |
long d = new Date().getTime(); | |
for (int i = 1; isLimit(d) && (i<=n || i<=k); i++) set.add(Integer.toString(i)); | |
System.out.println(set.toArray()[k - 1]); | |
} | |
public static boolean isLimit(long a) | |
{ | |
return new Date().getTime()-a<490; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment