1. 
/**
* FWP, Ausgewählte Probleme aus dem ACM Programming Contest, SS10
* Problem: 113 Power of Cryptography
*
* @author Robert Reichart
*
* Status : Accepted
* Runtime: 0.364
*/

import java.io.*;

class Main{
public static void main(String... args)throws Exception{
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
while (in.ready()){
String line = in.readLine();

double n=Double.parseDouble(line);
line=in.readLine();
double p=Double.parseDouble(line);
System.out.println(Math.round(Math.pow(Math.E, Math.log(p)/n)));
}
}
}


2.

package acm_113_power_of_cryptography;

import java.util.Scanner;

/**
* FWP, Ausgew¦hlte Probleme aus dem ACM Programming Contest, SS10
* Problem: acm_113_power_of_cryptography
* Link:
*
* @author Martin Lambeck
* @version 1.0, 18.08.2010
*
* Method : ad hoc
* Status : Accepted
* Runtime: 0.684
*/


public class Main
{
static Scanner sc = new Scanner(System.in);

public static void main (String...args)
{
while (testcase());
}

static boolean testcase()
{
if (!sc.hasNextInt())
return false;

long n = sc.nextLong();
double p = sc.nextDouble();



System.out.println((long) (Math.pow(p, 1.0 / n) + 0.5));

return true;
}
}