QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#765596 | #9736. Kind of Bingo | Konggee | RE | 0ms | 3628kb | C++20 | 1.3kb | 2024-11-20 14:46:23 | 2024-11-20 14:46:25 |
Judging History
answer
#include <iostream>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <numeric>
#include <array>
#include <tuple>
#include <cassert>
#include <random>
#include <chrono>
#define int long long
using namespace std;
using u32 = unsigned;
using i64 = long long;
using u64 = unsigned long long;
using PII = std::pair<int, int>;
//std::mt19937_64 rng {std::chrono::steady_clock::now().time_since_epoch().count()};
constexpr int N = 2e5 + 10;
void solve() {
int n, m, k;
std::cin >> n >> m >> k;
std::vector<int> a(n * m + 1);
for (int i = 1; i <= n * m; i ++) {
std::cin >> a[i];
}
if (k >= m) {
std::cout << m << "\n";
return;
}
std::vector<int> cnt(n * m + 1);
int maxx = 0;
for (int i = 1; i <= n * m; i ++) {
cnt[a[i] / m + 1] ++;
maxx = std::max(maxx, cnt[a[i] / m + 1]);
if (i >= m && maxx + k >= m) {
std::cout << i << "\n";
return;
}
}
return;
}
signed main() {
std::ios::sync_with_stdio(false);
std::cin.tie(0);
int T = 1;
std::cin >> T;
while (T --) {
solve();
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3628kb
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
Runtime Error
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 ...