QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#521639#7042. So EasyGarfieldTL 0ms0kbC++23931b2024-08-16 13:31:382024-08-16 13:31:38

Judging History

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

  • [2024-08-16 13:31:38]
  • 评测
  • 测评结果:TL
  • 用时:0ms
  • 内存:0kb
  • [2024-08-16 13:31:38]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
#define gyx ios::sync_with_stdio(false), cin.tie(0), cout.tie(0)
#define endl "\n"
#define int long long
const int inf = 0x3f3f3f3f;
const int INF = 0x3f3f3f3f3f3f3f3f;
const int N = 1e3 + 50;
const int ovo = 0;
int a[N][N];
int randint(int l, int r) {
    // random_device rd;
    mt19937 gen(time(NULL));
    if (l > r)
        swap(l, r);
    uniform_int_distribution<int> dis(l, r);
    return dis(gen);
}
signed main() {
    gyx;
    int n;
    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;
        }
    }
    int x0 = randint(1, n), y0 = randint(1, n);
    while(x0 == x || y0 == y){
        x0 = randint(1, n), y0 = randint(1, n);
    }
    cout << a[x0][y] + a[x][y0] - a[x0][y0];
    return ovo;
}

詳細信息

Test #1:

score: 0
Time Limit Exceeded

input:

3
1 2 1
0 -1 0
0 1 0

output:


result: