QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#717583#6611. United in Stormwindabbcc_1#WA 0ms3820kbC++20833b2024-11-06 18:24:042024-11-06 18:24:05

Judging History

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

  • [2024-11-06 18:24:05]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3820kb
  • [2024-11-06 18:24:04]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
using i64 = long long;
int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int n, m;
    i64 k;
    cin >> n >> m >> k;
    vector <int> a(m);
    for (int i = 0; i < n; i++) {
        string str;
        cin >> str;
        for (int j = 0; j < m; j++) {
            if (str[j] == 'A')a[j]++;
        }
    }

    i64 x = 0, y = 0;
    for (int i = 0; i < m; i++) {
        if (1LL * a[i] * (n - a[i]) >= k)x++;
        else y++;
    }
    //cerr << x << ' ' << y << '\n';

    auto qpow = [&](i64 x, i64 y)->i64{
        i64 res = 1;
        while (y) {
            if (y & 1)res *= x;
            y >>= 1, x = x * x;
        }
        return res;
    };

    i64 res = 1LL * (qpow(2, x) - 1) * qpow(2, y);

    cout << res;

}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

2 2 1
AA
BB

output:

3

result:

ok 1 number(s): "3"

Test #2:

score: 0
Accepted
time: 0ms
memory: 3820kb

input:

2 2 1
AA
AB

output:

2

result:

ok 1 number(s): "2"

Test #3:

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

input:

5000 10 12302135
AABAAAABBA
AAABAABBAB
BAABABAAAB
ABBAABBBBA
BAAAAABAAB
BABBAAAAAA
BABBABABAB
BBABBAAAAB
BABBABBBBA
AAAAAAABAA
BBBBBAABBA
BAABABBAAB
BABAAABAAA
AAAAABAABB
BBABAABABB
ABAABBABBA
BBBAAABABA
BAAABABBAB
ABAAAAABAA
AABBBBBBAA
ABBABBABBA
AABBBABBAB
BAABBAAABB
BAAABBBBBB
ABABBAABBB
BABBABBA...

output:

0

result:

wrong answer 1st numbers differ - expected: '300', found: '0'