Submission #47223531
Source Code Expand
Copy
#include <bits/stdc++.h>#define ll long longusing namespace std;ll n;int main(){ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);cin>>n;ll a=1;bool f=false;while (true){ll sum=1,t=a;while (t--) sum*=a;if (sum==n){
#include <bits/stdc++.h> #define ll long long using namespace std; ll n; int main() { ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); cin>>n; ll a=1; bool f=false; while (true) { ll sum=1,t=a; while (t--) sum*=a; if (sum==n) { f=true; break; } else if (sum>n) break; ++a; } if (f) cout<<a; else cout<<-1; return 0; }
Submission Info
Submission Time | |
---|---|
Task | B - A^A |
User | Lee2004 |
Language | C++ 20 (gcc 12.2) |
Score | 200 |
Code Size | 391 Byte |
Status | AC |
Exec Time | 1 ms |
Memory | 3596 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 200 / 200 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt |
All | 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 01_random_00.txt, 01_random_01.txt, 01_random_02.txt, 01_random_03.txt, 01_random_04.txt, 01_random_05.txt, 01_random_06.txt, 01_random_07.txt, 01_random_08.txt, 01_random_09.txt, 02_hack_1_00.txt, 02_hack_1_01.txt, 03_hack_2_00.txt, 03_hack_2_01.txt, 03_hack_2_02.txt, 03_hack_2_03.txt, 04_corner_00.txt, 04_corner_01.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
00_sample_00.txt | AC | 1 ms | 3460 KB |
00_sample_01.txt | AC | 1 ms | 3416 KB |
00_sample_02.txt | AC | 1 ms | 3456 KB |
01_random_00.txt | AC | 1 ms | 3400 KB |
01_random_01.txt | AC | 1 ms | 3388 KB |
01_random_02.txt | AC | 1 ms | 3456 KB |
01_random_03.txt | AC | 1 ms | 3468 KB |
01_random_04.txt | AC | 1 ms | 3416 KB |
01_random_05.txt | AC | 1 ms | 3388 KB |
01_random_06.txt | AC | 1 ms | 3452 KB |
01_random_07.txt | AC | 1 ms | 3420 KB |
01_random_08.txt | AC | 1 ms | 3524 KB |
01_random_09.txt | AC | 1 ms | 3432 KB |
02_hack_1_00.txt | AC | 1 ms | 3420 KB |
02_hack_1_01.txt | AC | 1 ms | 3596 KB |
03_hack_2_00.txt | AC | 1 ms | 3596 KB |
03_hack_2_01.txt | AC | 1 ms | 3460 KB |
03_hack_2_02.txt | AC | 1 ms | 3468 KB |
03_hack_2_03.txt | AC | 1 ms | 3416 KB |
04_corner_00.txt | AC | 1 ms | 3468 KB |
04_corner_01.txt | AC | 1 ms | 3460 KB |