1 solutions

  • 0
    @ 2025-5-12 17:16:02
    #include<bits/stdc++.h>
    using namespace std;
    typedef long long LL; 
    int main()
    {
    	LL n;
    	cin>>n;
    	int ans=-1;
    	for(int i=1;i<=100;i++)
    	{
    		LL t=1;
    		for(int j=1;j<=i;j++)
    		{
    			t=t*i;
    		}
    		if(t==n)
    		{
    			ans=i;
    			break;
    		}
    	}
    	cout<<ans;
    	return 0;
    }
    
    
    • 1

    Information

    ID
    2339
    Time
    1000ms
    Memory
    256MiB
    Difficulty
    1
    Tags
    (None)
    # Submissions
    17
    Accepted
    4
    Uploaded By