QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#329381#4832. Telepathyucup-team10690 7ms4244kbC++231.7kb2024-02-16 16:47:392024-02-16 16:47:40

Judging History

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

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

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 + a[now] + 1 << " ";
    }
    cout << '\n';
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

Flim
1000000 100000
1101111111100010011110111001110011110110100000111110011111111111110111110100000001001000000110111000000101110000001100111110100100000100010111001011111010001000101100101100001111011100110010010000100100100101110100100110101001001000001011111101111111001100101000010110001011011000...

output:

1 4 7 10 14 17 19 22 25 28 32 34 37 40 43 46 49 53 55 58 61 64 67 70 73 76 79 82 85 88 91 94 97 100 103 106 109 112 115 118 121 124 127 130 133 137 139 142 145 148 151 154 157 160 163 166 169 172 175 178 181 184 188 191 193 196 199 202 205 208 211 214 217 220 223 226 229 232 235 238 241 244 247 250 ...

input:

Flam
1000000 100000
0000001101000100010010001001011111000101010011011001010100101001110101001011001011100001011100110100011110011010100101110101101101100101111011000111001101001100010000010010101110101010111110001100110000110001001111010010000010111101110001011011101101010000111111011111100100010001...

output:

1 4 7 10 13 17 20 22 25 28 31 34 37 40 44 46 49 52 55 58 61 64 67 70 73 76 79 82 85 88 91 94 97 101 103 107 109 112 115 118 121 124 127 130 133 136 139 142 145 148 151 154 157 161 163 167 170 172 175 178 181 184 187 190 193 196 199 202 205 208 211 214 218 220 224 226 229 232 235 238 241 244 247 250 ...

result:

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