1 solutions

  • 0
    @ 2025-11-27 11:55:05

    C++ :

    #include <iostream>
    using namespace std;
    int main() {
    int n;
    cin >> n;
    long long product = 1;
    for (int i = 0; i < n; ++i) {
    int a;
    cin >> a;
    if (product * a > 1000000) {
    cout << ">1000000" << endl;
    return 0;
    }
    product *= a;
    }
    cout << product << endl;
    return 0;
    }
    
    • 1

    Information

    ID
    36
    Time
    1000ms
    Memory
    128MiB
    Difficulty
    (None)
    Tags
    # Submissions
    0
    Accepted
    0
    Uploaded By