/ SeriousOJ /

Record Detail

Time Exceeded


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 320.0 KiB
#2 Accepted 1ms 320.0 KiB
#3 Accepted 1ms 520.0 KiB
#4 Accepted 1ms 484.0 KiB
#5 Time Exceeded ≥1036ms ≥636.0 KiB
#6 Time Exceeded ≥1039ms ≥576.0 KiB

Code

/**
 *  written by Binoy Barman .
**/

#include<bits/stdc++.h>
using namespace std;
#define nl '\n'
#define all(v) v.begin(), v.end()
#define Too_Many_Jobs int tts, tc = 1; cin >> tts; hell: while(tts--)
#define Dark_Lord_Binoy ios_base::sync_with_stdio(false); cin.tie(NULL);

#ifdef LOCAL
#include "unravel.hpp"
#else
#define dbg(...) 42
#endif
#define ll long long

template<typename T> vector<T> divisors(T n) {
    vector<T> divs;
    for(T i = 1; i * i <= n; i++) {
        if(n % i == 0) {
            if(n / i == i) divs.push_back(i);
            else {
                divs.push_back(i);
                divs.push_back(n / i);
            }
        }
    }
    sort(divs.begin(), divs.end()); 
    return divs;
}

int32_t main() {
Dark_Lord_Binoy
#ifdef LOCAL
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    Too_Many_Jobs {
        int n;
        cin >> n;
        vector<int> d = divisors(n);
        cout << n / d[1] << nl;
    }

    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 15:11:25
Judged At
2024-11-11 03:35:00
Judged By
Score
25
Total Time
≥1039ms
Peak Memory
≥636.0 KiB