Time Exceeded
Code
#include<bits/stdc++.h>
#define ll long long
using namespace std;
int main(){
int t;
cin >> t;
while (t--){
int n, ans = 1;
cin >> n;
for (int i = 2; i * i <= n; i++){
if (n % i == 0){
ans = max({ans, n / i, (n / (n / i))});
}
}
cout << ans << endl;
}
}
Information
- Submit By
- Type
- Submission
- Problem
- P1052 Yet Another Array Partition
- Contest
- Brain Booster #3
- Language
- C++17 (G++ 13.2.0)
- Submit At
- 2024-05-06 15:23:56
- Judged At
- 2024-11-11 03:34:32
- Judged By
- Score
- 85
- Total Time
- ≥1020ms
- Peak Memory
- ≥620.0 KiB