結果

問題 No.1663 Maximum Remainder
ユーザー 野村大輔野村大輔
提出日時 2021-10-19 10:02:04
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 560 bytes
コンパイル時間 617 ms
コンパイル使用メモリ 63,196 KB
実行使用メモリ 12,152 KB
最終ジャッジ日時 2023-10-20 10:39:03
合計ジャッジ時間 7,628 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 -- -
testcase_02 -- -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;

int Recv(int x, int y, int max_X, int max_Y, int m){
    int answer = (x + y) % m;
    if(x < max_X){
        int value = Recv(x + 1, y, max_X, max_Y, m);
        if(value > answer){
            answer = value;
        }
    }
    if(y < max_Y){
        int value = Recv(x, y + 1, max_X, max_Y, m);
        if(value > answer){
            answer = value;
        }
    }

    return answer;
}

int main(){
    int a,b,c,d,m;
    cin >> a >> b >> c >> d >> m;

    cout << Recv( a, c, b, d, m) << '\n';

    return 0;
}
0