QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#746282#9736. Kind of Bingothe_fool#WA 0ms3820kbC++20785b2024-11-14 14:07:042024-11-14 14:07:04

Judging History

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

  • [2024-11-14 14:07:04]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3820kb
  • [2024-11-14 14:07:04]
  • 提交

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(n+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: 3820kb

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'