提出番号 | 2344 |
---|---|

提出者 | kya |

言語 | C++ |

提出日時 | 2020-03-25 18:24:30 |

問題名 | (13)エセ数列 |

結果 | WA |

点数 | 0% |

テストケース | 結果 | 得点 | 実行時間 | メモリ使用量 |
---|---|---|---|---|

1 | AC | 100% | 2ms | 7872KB |

2 | AC | 100% | 2ms | 7600KB |

3 | WA | 0% | 109ms | 0KB |

4 | WA | 0% | 106ms | 0KB |

5 | WA | 0% | 102ms | 0KB |

6 | WA | 0% | 102ms | 0KB |

7 | WA | 0% | 107ms | 0KB |

8 | WA | 0% | 102ms | 0KB |

9 | WA | 0% | 106ms | 0KB |

10 | WA | 0% | 101ms | 0KB |

11 | WA | 0% | 100ms | 0KB |

12 | WA | 0% | 100ms | 0KB |

13 | WA | 0% | 102ms | 0KB |

14 | WA | 0% | 103ms | 0KB |

15 | WA | 0% | 100ms | 0KB |

16 | WA | 0% | 100ms | 0KB |

17 | WA | 0% | 98ms | 0KB |

18 | WA | 0% | 107ms | 0KB |

19 | WA | 0% | 100ms | 0KB |

20 | WA | 0% | 100ms | 0KB |

21 | WA | 0% | 98ms | 0KB |

22 | WA | 0% | 100ms | 0KB |

23 | WA | 0% | 101ms | 0KB |

24 | WA | 0% | 99ms | 0KB |

25 | WA | 0% | 99ms | 0KB |

26 | WA | 0% | 97ms | 0KB |

27 | WA | 0% | 103ms | 0KB |

28 | WA | 0% | 102ms | 0KB |

29 | WA | 0% | 100ms | 0KB |

30 | WA | 0% | 98ms | 0KB |

```
#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(0);
cin.tie(nullptr);
long long n, m;
cin >> n >> m;
vector<vector<long long>> a(n, vector<long long>(m));
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {
cin >> a[i][j];
}
}
int q;
cin >> q;
while (q--) {
int i, j;
cin >> i >> j;
assert(1 < i and i < n and 1 < j and j < m);
i--; j--;
long long ans = a[i][j] + a[i+1][j] + a[i][j+1] + a[i-1][j] + a[i][j-1];
cout << ans << '\n';
}
return 0;
}
```