QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#785081#9736. Kind of BingoLonelyperRE 0ms0kbC++171.1kb2024-11-26 16:47:562024-11-26 16:47:57

Judging History

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

  • [2024-11-26 16:47:57]
  • 评测
  • 测评结果:RE
  • 用时:0ms
  • 内存:0kb
  • [2024-11-26 16:47:56]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef pair<int, int>PII;
#define endl '\n'
#define x first
#define y second
const int N = 2e5 + 10;
const LL INF = 1e18, mod = 1e9 + 7;
mt19937_64 rng(chrono::system_clock::now().time_since_epoch().count());


void Lonelyper(){
    int n, m, k;
    cin >> n >> m >> k;
    vector<vector<int>> a(n + 1, vector<int> (m + 1));
    for(int i = 1; i <= n * m; i ++){
        int res;
        cin >> res;
        int x = (res - 1) / m + 1;
        int y = res - (x - 1) * m;
        a[x][y] = i;
    }
    // for(int i = 1; i <= n; i ++){
    //     for(int j = 1; j <= m; j ++){
    //         cout << a[i][j] << ' ';
    //     }
    //     cout << endl;
    // }
    int ans = 1e9;
    for(int i = 1; i <= n; i ++){
        sort(a[i].begin() + 1, a[i].end());
        ans = min(ans, max(m, a[i][m - k]));
    }
    cout << ans << endl;
}

int main(){
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int t = 1;
    cin >> t;
    while(t --) {
        Lonelyper();
    }
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Runtime Error

input:

3
3 5 2
1 4 13 6 8 11 14 2 7 10 3 15 9 5 12
2 3 0
1 6 4 3 5 2
2 3 1000000000
1 2 3 4 5 6

output:


result: