QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#746272 | #9736. Kind of Bingo | the_fool# | WA | 0ms | 3580kb | C++20 | 785b | 2024-11-14 14:04:45 | 2024-11-14 14:04:46 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
using LL = long long;
void solve() {
int n,m,k;
cin>>n>>m>>k;
vector<int> y(n*m+1);
for(int i=1;i<=n;i++)
for(int j=1;j<=m;j++) {
int _;
cin>>_;
y[_] = i;
}
vector<int> cnt(m+1);
int res = 0x7f7f7f7f;
if(k >= m) res = 0;
else {
for(int i=1;i<=n*m;i++) {
cnt[y[i]] ++;
if(k >= m-cnt[y[i]]) {
res = i;
// cerr<<"Here"<<endl;
break;
}
}
}
cout<<max(res, m)<<endl;
}
signed main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int t = 1;
cin >> t;
while (t--) {
solve();
}
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3580kb
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:
6 5 3
result:
wrong answer 1st numbers differ - expected: '7', found: '6'