Submission #14716098


Source Code Expand

Copy
get_number(Number) :-
    get_string(String),
    number_string(Number, String).

get_string(String) :-
    current_input(Input),
    read_string(Input, ' \n', '', _, String).

/* memo
    code(int)
    string_code(1, S, C), (C: code)
    char_code(X, Y) (X: char, Y: code)

    f(0, [], []).
    f(Z, [X|Xs], [Y|Ys]) :- X = Y, f(Z1, Xs, Ys), Z is Z1 + 1.
    f(Z, [_|Xs], [_|Ys]) :- f(Z, Xs, Ys).
*/

main :-
    get_number(A),
    get_number(B),
    X is max(max(A + B, A - B), A * B),
    writeln(X).

Submission Info

Submission Time
Task A - +-x
User spica314
Language Prolog (SWI-Prolog 8.0.3)
Score 100
Code Size 527 Byte
Status AC
Exec Time 31 ms
Memory 8184 KB

Judge Result

Set Name All Sample
Score / Max Score 100 / 100 0 / 0
Status
AC × 12
AC × 3
Set Name Test Cases
All sample_01, sample_02, sample_03, testcase_0, testcase_1, testcase_2, testcase_3, testcase_4, testcase_5, testcase_6, testcase_7, testcase_8
Sample sample_01, sample_02, sample_03
Case Name Status Exec Time Memory
sample_01 AC 29 ms 8008 KB
sample_02 AC 26 ms 8184 KB
sample_03 AC 28 ms 8112 KB
testcase_0 AC 28 ms 8012 KB
testcase_1 AC 31 ms 8144 KB
testcase_2 AC 26 ms 7904 KB
testcase_3 AC 28 ms 7888 KB
testcase_4 AC 27 ms 8148 KB
testcase_5 AC 31 ms 7892 KB
testcase_6 AC 29 ms 8180 KB
testcase_7 AC 29 ms 8184 KB
testcase_8 AC 25 ms 8184 KB