QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#329383#4832. Telepathyucup-team10690 7ms4188kbC++231.7kb2024-02-16 16:49:402024-02-16 16:49:40

Judging History

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

  • [2024-02-16 16:49:40]
  • 评测
  • 测评结果:0
  • 用时:7ms
  • 内存:4188kb
  • [2024-02-16 16:49:40]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;

void prec() {
    int a[8], b[8];
    int x, y, mx = -1;
    for (int m1 = 0; m1 < 6561; ++m1) {
        for (int m2 = 0; m2 < 6561; ++m2) {
            for (int i = 0, x = m1; i < 8; ++i) {
                a[i] = (x % 3);
                //cout << a[i];
                x /= 3;
            }
            //cout << '\n';
            for (int i = 0, x = m2; i < 8; ++i) {
                b[i] = (x % 3);
                //cout << b[i];
                x /= 3;
            }
            //cout << "\n\n";
            int sum = 0;
            for (int i = 0; i < 8; ++i) {
                for (int j = 0; j < 8; ++j) {
                    if (((i >> a[i]) & 1) == ((j >> b[j]) & 1)) {
                        sum++;
                    }
                }
            }
            if (sum > mx) {
                mx = sum;
                x = m1, y = m2;
            }
        }
    }
    cout << mx << " " << x << " " << y << '\n';
    for (int i = 0, j = x; i < 8; ++i) {
        cout << (j % 3); 
        j /= 3;
    }
    cout << '\n';
    cout << setprecision(9) << fixed << (mx + .0) / (64.0) << '\n';
}

int main() {
    //prec();
    ios_base::sync_with_stdio(0), cin.tie(0);
    int n = 1e6, k = 1e5;
    string s, t;
    cin >> s >> n >> k >> t;
    int a[8];
    for (int i = 0, j = 300; i < 8; ++i) {
        a[i] = (j % 300);
        j /= 300;
    }
    for (int i = 0; i < k; ++i) {
        int now = 0;
        for (int j = 0; j < 3; ++j) {
            now *= 2;
            now += (t[3 * i + j] - '0');
        }
        cout << 3 * i + 3 - a[now] << " ";
    }
    cout << '\n';
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 7ms
memory: 4188kb

input:

Flim
1000000 100000
1101111111100010011110111001110011110110100000111110011111111111110111110100000001001000000110111000000101110000001100111110100100000100010111001011111010001000101100101100001111011100110010010000100100100101110100100110101001001000001011111101111111001100101000010110001011011000...

output:

3 6 9 12 14 17 21 24 27 30 32 36 39 42 45 48 51 53 57 60 63 66 69 72 75 78 81 84 87 90 93 96 99 102 105 108 111 114 117 120 123 126 129 132 135 137 141 144 147 150 153 156 159 162 165 168 171 174 177 180 183 186 188 191 195 198 201 204 207 210 213 216 219 222 225 228 231 234 237 240 243 246 249 252 ...

input:

Flam
1000000 100000
0000001101000100010010001001011111000101010011011001010100101001110101001011001011100001011100110100011110011010100101110101101101100101111011000111001101001100010000010010101110101010111110001100110000110001001111010010000010111101110001011011101101010000111111011111100100010001...

output:

3 6 9 12 15 17 20 24 27 30 33 36 39 42 44 48 51 54 57 60 63 66 69 72 75 78 81 84 87 90 93 96 99 101 105 107 111 114 117 120 123 126 129 132 135 138 141 144 147 150 153 156 159 161 165 167 170 174 177 180 183 186 189 192 195 198 201 204 207 210 213 216 218 222 224 228 231 234 237 240 243 246 249 252 ...

result:

wrong answer 53013 matched, but you need to match at least 66666 positions