QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#199760 | #7042. So Easy | MahmoudAtia# | WA | 0ms | 3756kb | C++14 | 896b | 2023-10-04 13:58:39 | 2023-10-04 13:58:40 |
Judging History
answer
#include <bits/stdc++.h>
typedef long double ld;
typedef long long ll;
using namespace std;
int di[] = {1, 0, -1, 0, 0, 1, -1, 1};
int dj[] = {0, 1, 0, -1, -1, 0, 1, -1};
const ll oo = 1e18;
const int N = 1005, M = 1e5 + 5, MOD = 998244353;
#define EPS 1e-9
int n, m, a[N][N];
int main() {
// ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
cin >> n;
int x, y;
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= n; j++) {
cin >> a[i][j];
if (a[i][j] == -1) x = i, y = j;
}
}
if (x < n && y < n) cout << a[x + 1][y] - a[x + 1][y + 1] - a[x][y + 1];
else if (x < n && y > 1) cout << a[x + 1][y] - a[x + 1][y - 1] - a[x][y - 1];
else if (x > 1 && y < n)cout << a[x - 1][y] - a[x - 1][y + 1] - a[x][y + 1];
else cout << a[x - 1][y] - a[x - 1][y - 1] - a[x][y - 1];
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3528kb
input:
3 1 2 1 0 -1 0 0 1 0
output:
1
result:
ok 1 number(s): "1"
Test #2:
score: -100
Wrong Answer
time: 0ms
memory: 3756kb
input:
10 63 66 64 39 41 64 67 46 45 56 67 70 68 43 45 68 71 50 49 60 72 75 73 48 50 73 76 55 54 65 64 67 65 40 42 65 68 47 46 57 81 84 82 57 59 82 85 64 63 74 43 46 44 19 21 44 47 26 25 36 45 48 46 21 23 -1 49 28 27 38 70 73 71 46 48 71 74 53 52 63 57 60 58 33 35 58 61 40 39 50 81 84 82 57 59 82 85 64 63 74
output:
-52
result:
wrong answer 1st numbers differ - expected: '46', found: '-52'