結果
問題 |
No.131 マンハッタン距離
|
ユーザー |
|
提出日時 | 2017-11-13 22:58:55 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 484 bytes |
コンパイル時間 | 1,262 ms |
コンパイル使用メモリ | 164,540 KB |
実行使用メモリ | 247,632 KB |
最終ジャッジ日時 | 2024-11-25 00:33:49 |
合計ジャッジ時間 | 10,145 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 RE * 1 |
other | AC * 13 RE * 11 |
ソースコード
#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; }