Submission #247290

# Submission time Handle Problem Language Result Execution time Memory
247290 2020-07-11T08:38:04 Z cheeheng Mouse (info1cup19_mouse) C++14
0 / 100
6 ms 384 KB
#include <bits/stdc++.h>
#include "grader.h"

using namespace std;

static const int Nmax = 500;

int query(vector<int> q);

vector<int> q[51];
int x[51];

void solve(int N){
    if(N <= 7){
        for(int i = 0; i < 49; i ++){
            q[i] = vector<int>();
            for(int j = 1; j <= 7; j ++){
                q[i].push_back(j);
            }
            random_shuffle(q[i].begin(), q[i].end());
            x[i] = query(q[i]);
        }

        vector<int> p;
        for(int i = 1; i < 8; i ++){
            p.push_back(i);
        }
        do{
            int match = 1;
            for(int k = 0; k < 49; k ++){
                int score = 0;
                for(int i = 0; i < 7; i ++){
                    score += (p[i] == q[k][i]);
                }
                if(score != x[k]){
                    match = 0;
                }
            }
            if(match){query(p);return;}
        }while(next_permutation(p.begin(), p.end()));
    }
}
# Verdict Execution time Memory Grader output
1 Correct 6 ms 384 KB Correct! Number of queries: 50
2 Incorrect 6 ms 384 KB Integer 5 violates the range [1, 4]
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 6 ms 384 KB Correct! Number of queries: 50
2 Incorrect 6 ms 384 KB Integer 5 violates the range [1, 4]
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 6 ms 384 KB Correct! Number of queries: 50
2 Incorrect 6 ms 384 KB Integer 5 violates the range [1, 4]
3 Halted 0 ms 0 KB -