Submission #13788033


Source Code Expand

Copy
#include <bits/stdc++.h>
using namespace std;

int main(){
    int N;
    cin >> N;
    __int128_t M = 1, INF = int64_t(1e18) + 1;
    while(N--){
        int64_t a;
        cin >> a;
        M = min(M*a, INF);
    }
    if(M == INF) M = -1;
    cout << int64_t(M) << endl;
    return 0;
}

Submission Info

Submission Time
Task B - Multiplication 2
User betrue12
Language C++ (GCC 9.2.1)
Score 200
Code Size 306 Byte
Status AC
Exec Time 57 ms
Memory 3636 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 3
AC × 24
Set Name Test Cases
Sample sample_01.txt, sample_02.txt, sample_03.txt
All hand_01.txt, hand_02.txt, max_01.txt, max_02.txt, random_01.txt, random_02.txt, random_03.txt, sample_01.txt, sample_02.txt, sample_03.txt, small11_02.txt, small11_03.txt, small11_04.txt, small12_02.txt, small12_03.txt, small12_04.txt, small21_01.txt, small21_02.txt, small21_03.txt, small22_01.txt, small22_02.txt, small22_03.txt, zero_01.txt, zero_02.txt
Case Name Status Exec Time Memory
hand_01.txt AC 2 ms 3568 KB
hand_02.txt AC 2 ms 3388 KB
max_01.txt AC 57 ms 3408 KB
max_02.txt AC 17 ms 3568 KB
random_01.txt AC 36 ms 3624 KB
random_02.txt AC 32 ms 3520 KB
random_03.txt AC 34 ms 3568 KB
sample_01.txt AC 2 ms 3524 KB
sample_02.txt AC 2 ms 3524 KB
sample_03.txt AC 2 ms 3520 KB
small11_02.txt AC 2 ms 3624 KB
small11_03.txt AC 2 ms 3408 KB
small11_04.txt AC 2 ms 3392 KB
small12_02.txt AC 2 ms 3544 KB
small12_03.txt AC 2 ms 3568 KB
small12_04.txt AC 2 ms 3520 KB
small21_01.txt AC 19 ms 3564 KB
small21_02.txt AC 17 ms 3636 KB
small21_03.txt AC 17 ms 3592 KB
small22_01.txt AC 20 ms 3592 KB
small22_02.txt AC 17 ms 3388 KB
small22_03.txt AC 19 ms 3436 KB
zero_01.txt AC 51 ms 3588 KB
zero_02.txt AC 51 ms 3432 KB