QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#410144#677. Koala GameAmrT#15 8ms4076kbC++142.4kb2024-05-13 16:15:062024-05-13 16:15:07

Judging History

This is the latest submission verdict.

  • [2024-05-13 16:15:07]
  • Judged
  • Verdict: 15
  • Time: 8ms
  • Memory: 4076kb
  • [2024-05-13 16:15:06]
  • Submitted

answer

#include <bits/stdc++.h>
#pragma GCC optimize("-Ofast")
#define lop(ind, n) for(ll ind = 0; ind < (ll)n; ind++)
#define in(v) for(auto &ind: v) cin >> ind;
#define alop(ind,v) for(auto &ind: v)
#define ll long long
#define ld long double
//#define endl '\n'
#define all(v) v.begin(),v.end()
#define mem(dp, x) memset(dp, x, sizeof(dp))
#define sq(x) ((x) * (x))
#define pb push_back
using namespace std;
const ll mod = 1e9 + 7;

#include "koala.h"

int minValue(int N, int W) {
    // TODO: Implement Subtask 1 solution here.
    // You may leave this function unmodified if you are not attempting this
    // subtask.
    return 0;
}


int maxValue(int N, int W) {
    const ll Nm = 100;
    bitset<Nm> great;
    int guess[Nm] = {}, result[Nm] = {};

    lop(i, Nm) 
        great[i] = guess[i] = 1;
    playRound(guess, result);

    lop(i, Nm){
        if(guess[i] >= result[i]) great[i] = 0;
    }

    if(great.count() == 1){
        lop(i, Nm){
            if(great[i]) return i;
        }
    }

    mem(guess, 0);
    lop(i, Nm){
        if(great[i]) guess[i] = 2;
    }
    playRound(guess, result);
    lop(i, Nm){
        if(guess[i] >= result[i]) great[i] = 0;
    }
    if(great.count() == 1){
        lop(i, Nm){
            if(great[i]) return i;
        }
    }

    mem(guess, 0);

    lop(i, Nm){
        if(great[i]) guess[i] = 4;
    }
    playRound(guess, result);
    lop(i, Nm){
        if(guess[i] >= result[i]) great[i] = 0;
    }

    if(great.count() == 1){
        lop(i, Nm){
            if(great[i]) return i;
        }
    }


    mem(guess, 0);

    lop(i, Nm){
        if(great[i]) guess[i] = 11;
    }
    playRound(guess, result);

    lop(i, Nm){
        if(great[i] && guess[i] < result[i] && result[i] != 1) return i;
    }
}

int greaterValue(int N, int W) {
    // TODO: Implement Subtask 3 solution here.
    // You may leave this function unmodified if you are not attempting this
    // subtask.
    return 0;
}

void allValues(int N, int W, int *P) {
    if (W == 2*N) {
        // TODO: Implement Subtask 4 solution here.
        // You may leave this block unmodified if you are not attempting this
        // subtask.
    } else {
        // TODO: Implement Subtask 5 solution here.
        // You may leave this block unmodified if you are not attempting this
        // subtask.
    }
}
/*
2 1
15 15 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
*/

详细

Subtask #1:

score: 0
Wrong Answer

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3792kb

input:

1 100 2
100 100 46 17 44 52 18 67 69 100 62 96 33 64 41 47 87 54 99 32 14 4 89 73 70 20 81 42 8 80 65 88 36 11 53 98 56 94 79 57 1 76 31 7 72 13 21 92 86 66 90 24 40 75 68 15 37 25 43 58 60 3 82 85 28 16 71 97 22 38 9 39 48 78 74 91 50 35 29 27 10 12 6 19 5 34 95 59 93 83 30 49 51 61 26 23 77 55 45 ...

output:

-1

result:

wrong answer 

Subtask #2:

score: 15
Accepted

Test #5:

score: 15
Accepted
time: 8ms
memory: 3812kb

input:

2 100 13
100 100 65 36 67 86 38 76 15 17 13 93 83 57 46 90 14 2 52 88 29 74 55 66 79 75 37 81 87 47 56 25 33 39 8 31 64 73 98 78 100 94 10 58 61 70 53 54 21 49 16 5 4 85 44 62 27 92 91 26 72 41 42 99 89 77 12 69 60 24 3 30 40 1 84 68 59 28 11 71 96 97 63 32 18 34 43 82 48 35 95 80 7 45 19 23 51 22 5...

output:

4

result:

points 1.0 number of queries is 4

Test #6:

score: 15
Accepted
time: 8ms
memory: 4076kb

input:

2 100 13
100 100 86 98 14 10 46 93 8 40 9 61 74 35 76 6 53 50 44 88 43 42 84 57 79 39 58 13 28 77 83 16 34 49 71 45 20 64 18 68 24 15 26 38 72 85 82 21 75 52 23 100 37 36 99 12 62 4 33 11 27 81 95 2 70 65 87 30 56 90 48 66 25 41 51 3 92 63 60 80 7 22 19 89 29 94 97 32 31 59 96 91 78 69 5 55 73 67 17...

output:

4

result:

points 1.0 number of queries is 4

Test #7:

score: 15
Accepted
time: 8ms
memory: 3788kb

input:

2 100 13
100 100 86 7 41 38 96 16 6 65 92 85 88 13 80 64 45 37 34 14 44 12 78 66 79 10 3 69 43 91 97 22 11 1 26 56 81 59 39 94 40 9 15 90 48 20 74 68 55 29 2 23 46 93 24 35 95 72 82 31 100 71 52 60 87 89 75 8 57 28 33 63 21 62 84 25 58 47 30 42 61 19 54 17 27 5 36 99 49 51 18 4 98 50 77 76 73 32 83 ...

output:

4

result:

points 1.0 number of queries is 4

Test #8:

score: 15
Accepted
time: 4ms
memory: 3784kb

input:

2 99 13
100 100 64 61 58 62 76 63 68 57 69 66 70 77 67 73 75 60 74 71 72 59 65 3 2 1 50 54 41 46 45 35 55 33 39 44 53 52 40 51 38 56 49 34 37 31 36 42 48 47 43 32 84 98 86 87 99 80 78 100 89 95 93 83 96 92 85 91 97 94 88 90 79 81 82 20 10 9 16 11 17 19 4 7 18 12 13 22 27 8 6 24 29 28 23 15 26 30 25 ...

output:

4

result:

points 1.0 number of queries is 4

Subtask #3:

score: 0
Wrong Answer

Test #9:

score: 0
Wrong Answer
time: 0ms
memory: 3784kb

input:

3 1100 14
100 100 50 78 94 90 6 24 52 93 73 4 7 5 40 2 17 41 27 8 21 16 64 80 96 12 46 57 38 22 69 92 47 10 60 13 76 62 30 74 31 82 91 32 36 53 84 98 44 77 19 49 83 71 79 15 87 37 20 85 48 51 68 55 3 81 1 34 99 97 26 9 75 35 28 56 33 65 54 25 18 66 11 63 43 61 88 45 89 23 39 29 100 58 67 95 42 59 72...

output:

-1

result:

wrong answer 

Subtask #4:

score: 0
Wrong Answer

Test #19:

score: 0
Wrong Answer
time: 0ms
memory: 3788kb

input:

4 1 700
100 200 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98...

output:

-1

result:

wrong answer 

Subtask #5:

score: 0
Wrong Answer

Test #39:

score: 0
Wrong Answer
time: 0ms
memory: 3724kb

input:

4 1 3200
100 100 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 9...

output:

-1

result:

wrong answer