/ SeriousOJ /

Record Detail

Time Exceeded


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 324.0 KiB
#2 Accepted 1ms 320.0 KiB
#3 Accepted 2ms 516.0 KiB
#4 Accepted 2ms 320.0 KiB
#5 Accepted 216ms 608.0 KiB
#6 Time Exceeded ≥1091ms ≥548.0 KiB
#7 Time Exceeded ≥1093ms ≥552.0 KiB

Code

//Fahmidur Rahman Nafi 62 [i]
#include <bits/stdc++.h>
using namespace std;

long long int max_div(long long int num){
    //long long int largest = 1; 
    if (num % 2 == 0)
        return num / 2;
    for (long long int i = 2; i <= sqrt(num); i++){
        if (num % i == 0){
            return num / i ;
            //break;
        }
    }
    return 1;
}

int main() {
    long long int t;
    cin >> t;
    while (t--) {
        long long int n;
        cin >> n;
        cout << max_div(n) << endl;
    }
    return 0;
}

Information

Submit By
Type
Submission
Problem
P1052 Yet Another Array Partition
Contest
Brain Booster #3
Language
C++20 (G++ 13.2.0)
Submit At
2024-05-06 17:46:04
Judged At
2024-11-11 03:31:55
Judged By
Score
40
Total Time
≥1093ms
Peak Memory
≥608.0 KiB