結果
| 問題 | No.3236 累乗数大好きbot |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-08-15 22:20:49 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 66 ms / 4,000 ms |
| + 892µs | |
| コード長 | 677 bytes |
| 記録 | |
| コンパイル時間 | 1,125 ms |
| コンパイル使用メモリ | 213,736 KB |
| 実行使用メモリ | 11,876 KB |
| 最終ジャッジ日時 | 2026-07-14 03:23:26 |
| 合計ジャッジ時間 | 4,923 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 31 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
ll r = 1'000'000'000'000ll;
vector<vector<ll>> tb(41);
for(ll i = 2; i <= 1'000'000; i++){
ll d = i * i;
int cur = 2;
while(d <= r){
tb[cur++].emplace_back(d);
d *= i;
}
}
int Q;
cin >> Q;
while(Q--){
ll n;
cin >> n;
int ans = 1;
for(int i = 40; i >= 2; i--){
if(binary_search(tb[i].begin(), tb[i].end(), n)){
ans = i;
break;
}
}
cout << ans << '\n';
}
}