Submission #19487349


Source Code Expand

Copy
#include<bits/stdc++.h>
using namespace std;

int main(){
  long long int N,P;
  cin >> N >> P;
  if(N == 1) cout << P << endl;
  else{
    long long int ans=1;
    for(int i=2; ;i++){
      if(pow(i,N) > P) break;
      if(P%(long long int)pow(i,N) == 0) ans = i;
    }
    cout << ans << endl;
  }
}

Submission Info

Submission Time
Task C - Product and GCD
User Aurora2005
Language C++ (GCC 9.2.1)
Score 300
Code Size 316 Byte
Status AC
Exec Time 35 ms
Memory 4064 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
AC × 4
AC × 34
Set Name Test Cases
Sample sample1.txt, sample2.txt, sample3.txt, sample4.txt
All sample1.txt, sample2.txt, sample3.txt, sample4.txt, 1.txt, 10.txt, 11.txt, 12.txt, 13.txt, 14.txt, 15.txt, 16.txt, 17.txt, 18.txt, 19.txt, 2.txt, 20.txt, 21.txt, 22.txt, 23.txt, 24.txt, 25.txt, 26.txt, 3.txt, 4.txt, 5.txt, 6.txt, 7.txt, 8.txt, 9.txt, sample1.txt, sample2.txt, sample3.txt, sample4.txt
Case Name Status Exec Time Memory
1.txt AC 7 ms 3812 KB
10.txt AC 3 ms 3904 KB
11.txt AC 2 ms 3736 KB
12.txt AC 4 ms 3972 KB
13.txt AC 2 ms 4060 KB
14.txt AC 3 ms 3856 KB
15.txt AC 2 ms 3804 KB
16.txt AC 2 ms 4064 KB
17.txt AC 2 ms 4020 KB
18.txt AC 2 ms 4020 KB
19.txt AC 2 ms 3868 KB
2.txt AC 3 ms 3820 KB
20.txt AC 2 ms 3808 KB
21.txt AC 3 ms 3356 KB
22.txt AC 4 ms 3492 KB
23.txt AC 2 ms 3456 KB
24.txt AC 2 ms 3428 KB
25.txt AC 2 ms 3864 KB
26.txt AC 2 ms 4024 KB
3.txt AC 2 ms 4028 KB
4.txt AC 2 ms 3736 KB
5.txt AC 5 ms 4064 KB
6.txt AC 3 ms 3876 KB
7.txt AC 35 ms 3640 KB
8.txt AC 2 ms 3740 KB
9.txt AC 34 ms 3716 KB
sample1.txt AC 2 ms 3876 KB
sample2.txt AC 5 ms 3968 KB
sample3.txt AC 2 ms 3488 KB
sample4.txt AC 3 ms 3736 KB