QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#188143#7236. Set intersectionucup-team004WA 0ms3808kbC++201.1kb2023-09-25 15:39:002023-09-25 15:39:01

Judging History

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

  • [2023-09-25 15:39:01]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3808kb
  • [2023-09-25 15:39:00]
  • 提交

answer

#include <bits/stdc++.h>

using i64 = long long;

int main() {
    std::ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
    
    int n;
    std::cin >> n;
    
    std::vector<std::bitset<12000>> s(n + 1);
    std::vector<int> cnt(2 * n);
    for (int i = 0; i < n + 1; i++) {
        std::string a;
        std::cin >> a;
        for (int j = 0; j < a.size(); j++) {
            for (int k = 0; k < 6 && j * 6 + k < 2 * n; k++) {
                s[i][j * 6 + k] = (a[j] - 33) >> k & 1;
            }
        }
        for (int j = 0; j < 2 * n; j++) {
            cnt[s[i][j]]++;
        }
    }
    
    for (int i = 0; i < n + 1; i++) {
        int sum = 0;
        for (int j = 0; j < 2 * n; j++) {
            sum += s[i][j] ? n + 1 - cnt[j] : cnt[j];
        }
        if (sum < (n - 1) * (n + 2)) {
            for (int j = 0; j < n + 1; j++) {
                if (i != j && (s[i] ^ s[j]).count() <= n) {
                    std::cout << i + 1 << " " << j + 1 << "\n";
                    return 0;
                }
            }
        }
    }
    
    return 0;
}

详细

Test #1:

score: 100
Accepted
time: 0ms
memory: 3808kb

input:

4
7"
*$
D#
M"
;"

output:

3 2

result:

ok OK (n = 3, i = 3, j = 2, intersection = 2)

Test #2:

score: -100
Wrong Answer
time: 0ms
memory: 3620kb

input:

10
EVK#
IH=#
676"
R7,#
74S"
6V2#
O3J#
S-7$
NU5"
C[$$
3N.#

output:


result:

wrong output format Unexpected end of file - int32 expected