QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#785081 | #9736. Kind of Bingo | Lonelyper | RE | 0ms | 0kb | C++17 | 1.1kb | 2024-11-26 16:47:56 | 2024-11-26 16:47:57 |
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;
}
详细
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