結果

問題 No.131 マンハッタン距離
ユーザー ikomikom
提出日時 2017-11-13 22:58:55
言語 C++11
(gcc 11.4.0)
結果
RE  
実行時間 -
コード長 484 bytes
コンパイル時間 2,096 ms
コンパイル使用メモリ 149,324 KB
実行使用メモリ 247,648 KB
最終ジャッジ日時 2023-08-16 12:05:13
合計ジャッジ時間 9,613 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,384 KB
testcase_01 RE -
testcase_02 AC 2 ms
4,384 KB
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 AC 2 ms
4,384 KB
testcase_08 AC 1 ms
4,384 KB
testcase_09 AC 2 ms
4,384 KB
testcase_10 AC 1 ms
4,380 KB
testcase_11 AC 2 ms
4,384 KB
testcase_12 RE -
testcase_13 RE -
testcase_14 AC 1 ms
4,380 KB
testcase_15 AC 1 ms
4,380 KB
testcase_16 AC 1 ms
4,380 KB
testcase_17 RE -
testcase_18 AC 1 ms
4,384 KB
testcase_19 AC 2 ms
4,384 KB
testcase_20 AC 1 ms
4,380 KB
testcase_21 AC 2 ms
4,380 KB
testcase_22 AC 2 ms
4,384 KB
testcase_23 RE -
testcase_24 RE -
testcase_25 RE -
testcase_26 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

int main() {

    long long x,y,
              ans = 0;
    unsigned long long d;

    cin >> x >> y >> d;

    vector<vector<bool> > grid(d+1,vector<bool>(d+1,false));

    for(int i = 0;i <=d;i++){
        int dx = i,
            dy = d-i;
        grid[dx][dy] = true;
    }

    for(int i = 0;i <= x;i++){
        for(int j = 0;j <= y;j++){
            if(grid[i][j]) ans++;
        }
    }

    cout << ans << endl;

    return 0;
}
0