QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#521655#7042. So EasyQFshengxiu#WA 0ms3796kbC++201.5kb2024-08-16 13:40:042024-08-16 13:40:05

Judging History

你现在查看的是最新测评结果

  • [2024-08-16 13:40:05]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3796kb
  • [2024-08-16 13:40:04]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define rep(i, a, n) for (int i = a; i <= n; i++)
#define pb push_back
#define fi first
#define se second
#define sz(x) x.size()
#define lowbit(x) (x & (-x))
#define all(x) x.begin(), x.end()
#define inf 0x3f3f3f3f3f3f3f3f
#define int long long
#define pai 3.14
#define QF ios::sync_with_stdio(false), cin.tie(0), cout.tie(0)
#define c1 cout << 1
#define c2 cout << 2
// #define width cout << ""
using ll = long long;
using PII = pair<int, int>;
using LD = long double;

mt19937_64 rnd(chrono::duration_cast<chrono::nanoseconds>(chrono::system_clock::now().time_since_epoch()).count());
constexpr int N = 1e3 + 10;
int a[N][N], row[N], col[N];
void solve()
{
    int n;
    cin >> n;
    int rows, cols;
    for (int i = 1; i <= n; i++)
    {
        for (int j = 1; j <= n; j++)
        {
            cin >> a[i][j];
            if (a[i][j] == -1)
            {
                rows = i;
                cols = j;
            }
        }
    }
    int minn = inf, minn2 = inf;
    for (int i = 1; i <= n; i++)
    {
        if (i == cols)
            continue;
        minn = min(minn, a[rows][i]);
    }
    for (int i = 1; i <= n; i++)
    {
        if (i == rows)
            continue;
        minn2 = min(minn2, a[i][cols]);
    }
    cout << minn + minn2 << endl;
}
signed main()
{
    QF;
    int T = 1;
    // cin >> T;
    for (int i = 1; i <= T; i++)
    {
        solve();
        // cout << endl;
    }
}

详细

Test #1:

score: 100
Accepted
time: 0ms
memory: 3744kb

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: 3796kb

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:

65

result:

wrong answer 1st numbers differ - expected: '46', found: '65'