Contest Duration: - (local time) (100 minutes) Back to Home

Submission #12836896

Source Code Expand

Copy
```#include "bits/stdc++.h"
using namespace std;

typedef long long ll;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef pair<ll, ll> P;
#define rep(i, n) for(ll i = 0; i < n; i++)
#define REP(i, a, b) for(ll i = a; i <= b; i++)
#define out(x) std::cout << x << '\n'
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define pb push_back
#define sz(x) ((int)(x).size())
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll lcm(ll a, ll b) { ll g = gcd(a, b); return a / g * b; }
const int dx[4] = { 1, 0, -1,  0 };
const int dy[4] = { 0, 1,  0, -1 };
const int INF = (int)1e9;
const ll  inf = (ll)1e18;
const int mod = 1000000007;
const int MAX_N = 100010;
const double PI = acos(-1);

int main() {
cin.tie(0);
ios::sync_with_stdio(false);
cout << fixed << setprecision(10);
/*------------------------------*/

int x;
cin >> x;

vector<int> v(x + 1);
v[1] = 1;
for (int i = 2; i <= x; i++) {
int t = i * i;
while (t <= x) {
v[t] = 1;
t *= i;
}
}

for (int i = x; i >= 1; i--) {
if (v[i]) {
out(i);
return 0;
}
}

return 0;
}```

#### Submission Info

Submission Time 2020-05-05 07:39:13+0900 B - Exponential tako_39 C++14 (GCC 5.4.1) 200 1215 Byte AC 1 ms 256 KB

#### Judge Result

Set Name Sample All
Score / Max Score 0 / 0 200 / 200
Status
 AC × 3
 AC × 9
Set Name Test Cases
Sample 0_000.txt, 0_001.txt, 0_002.txt
All 0_000.txt, 0_001.txt, 0_002.txt, 1_003.txt, 1_004.txt, 1_005.txt, 1_006.txt, 1_007.txt, 1_008.txt
Case Name Status Exec Time Memory
0_000.txt AC 1 ms 256 KB
0_001.txt AC 1 ms 256 KB
0_002.txt AC 1 ms 256 KB
1_003.txt AC 1 ms 256 KB
1_004.txt AC 1 ms 256 KB
1_005.txt AC 1 ms 256 KB
1_006.txt AC 1 ms 256 KB
1_007.txt AC 1 ms 256 KB
1_008.txt AC 1 ms 256 KB