QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#880786 | #9736. Kind of Bingo | frankly6 | WA | 2ms | 7084kb | C++17 | 946b | 2025-02-03 20:08:33 | 2025-02-03 20:08:33 |
Judging History
answer
#include<iostream>
#include<cstdio>
#include<queue>
using namespace std;
const int MX=100010;
const int inf=0x3fffffff;
int T, N, M, K;
int p[MX];
int read()
{
int r=0, f=1; char ch=getchar();
while(ch<'0'||ch>'9') {if(ch=='-') f=-1; ch=getchar();}
while(ch>='0'&&ch<='9') {r=r*10+ch-'0'; ch=getchar();}
return r*f;
}
priority_queue<int> q[MX];
int main()
{
// freopen("testdata.in","r",stdin);
T=read();
while(T--)
{
N=read(); M=read(); K=read();
for(int i=1;i<=N;i++)
while(!q[i].empty()) q[i].pop();
for(int i=1;i<=N*M;i++)
{
p[i]=read();
q[(p[i]-1)/M+1].emplace(i);
}
int ans=inf;
for(int i=1;i<=N;i++)
{
int tag=0, t=K;
while(!q[i].empty())
{
int x=q[i].top(); q[i].pop();
// cout << "x=" << x << '\n';
if(t==0) {ans=min(ans,x); tag=1; break;}
else t--;
}
if(!tag) ans=min(ans,M);
}
cout << ans << '\n';
}
return (0-0);
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 7020kb
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:
7 5 3
result:
ok 3 number(s): "7 5 3"
Test #2:
score: -100
Wrong Answer
time: 2ms
memory: 7084kb
input:
10000 1 9 7 8 9 1 5 3 7 4 6 2 1 8 2 7 5 1 6 4 2 3 8 1 1 0 1 1 8 3 5 7 8 3 2 1 4 6 1 10 948645336 3 10 1 6 2 8 9 5 7 4 1 1 0 1 1 10 7 5 3 10 8 1 7 4 9 6 2 1 9 6 4 8 5 7 2 6 3 1 9 1 7 1 3 5 1 6 2 7 4 1 6 6 5 3 1 2 4 6 1 1 1 1 1 2 0 1 2 1 1 1 1 1 6 3 5 6 2 4 3 1 1 5 673454194 2 3 1 4 5 1 4 1 1 4 2 3 1 ...
output:
2 6 1 5 10 1 3 3 6 6 1 2 1 3 5 3 1 3 3 3 6 4 9 10 3 6 2 1 3 1 2 5 6 1 3 1 3 9 1 1 4 2 8 4 3 1 5 6 1 4 7 1 6 5 2 2 7 1 2 6 8 7 1 2 6 2 2 1 2 4 4 3 1 2 1 1 2 1 4 7 2 3 1 1 2 3 3 2 4 1 8 2 4 1 2 4 1 4 4 6 9 6 4 4 2 3 6 2 2 6 6 10 7 6 1 3 2 3 8 3 4 4 5 6 2 7 5 5 5 3 3 2 6 4 7 4 7 8 8 1 1 2 5 2 3 10 4 2 ...
result:
wrong answer 1st numbers differ - expected: '9', found: '2'