QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#580040#9162. COVID testsliuziao53.14 1970ms18076kbC++233.5kb2024-09-21 19:51:132024-09-21 19:51:13

Judging History

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

  • [2024-09-21 19:51:13]
  • 评测
  • 测评结果:53.14
  • 用时:1970ms
  • 内存:18076kb
  • [2024-09-21 19:51:13]
  • 提交

answer

#include <bits/stdc++.h>

// #define int int64_t

const int kMaxN = 1e3 + 5;

int n;
int trans[kMaxN][kMaxN];
double p, pw[kMaxN], f[kMaxN][kMaxN];
std::mt19937 rnd(std::random_device{}());

bool test_students(std::vector<bool> mask) {
  assert(mask.size() == (size_t)n);

  std::string mask_str(n, ' ');
  for (int i = 0; i < n; i++) mask_str[i] = mask[i] ? '1' : '0';

  printf("Q %s\n", mask_str.c_str());
  fflush(stdout);

  char answer;
  scanf(" %c", &answer);
  return answer == 'P';
}

bool ask(std::vector<int> vec) {
  std::vector<bool> mask(n);
  for (auto x : vec) mask[x] = 1;
  return test_students(mask);
}

void del(std::vector<int> &v1, std::vector<int> &v2) {
  static bool vis[kMaxN] = {0};
  for (auto x : v1) vis[x] = 1;
  for (auto x : v2) vis[x] = 0;
  std::vector<int> tmp;
  std::swap(v1, tmp);
  for (auto x : tmp) {
    if (vis[x]) v1.emplace_back(x);
    vis[x] = 0;
  }
}

void solve(std::vector<int> v1, std::vector<int> v2, std::vector<bool> &answer) {
  static bool vis[kMaxN] = {0};
  int a = (int)v1.size(), b = (int)v2.size();
  std::shuffle(v1.begin(), v1.end(), rnd);
  std::shuffle(v2.begin(), v2.end(), rnd);
  if (!a) return;
  if (b == 1) {
    answer[v2[0]] = ask({v2[0]});
    del(v1, v2);
    solve(v1, {}, answer);
  } else if (!b) {
    int k = trans[a][b];
    std::vector<int> vec;
    for (int i = 0; i < k; ++i) vec.emplace_back(v1[i]);
    if (!ask(vec)) {
      del(v1, vec);
      solve(v1, {}, answer);
    } else {
      solve(v1, vec, answer);
    }
  } else {
    int k = trans[a][b];
    std::vector<int> vec;
    for (int i = 0; i < k; ++i) vec.emplace_back(v2[i]);
    if (!ask(vec)) {
      del(v1, vec), del(v2, vec);
      solve(v1, v2, answer);
    } else {
      solve(v1, vec, answer);
    }
  }
}

std::vector<bool> find_positive(bool op) {
  if (!op) {
    std::vector<bool> answer(n);
    for (int i = 0; i < n; ++i) {
      std::vector<bool> vec(n);
      vec[i] = 1;
      answer[i] = test_students(vec);
    }
    return answer;
  } else {
    std::vector<int> vec;
    std::vector<bool> answer(n);
    for (int i = 0; i < n; ++i) vec.emplace_back(i);
    solve(vec, {}, answer);
    return answer;
  }
}

void prework() {
  pw[0] = 1;
  for (int i = 1; i <= n; ++i) pw[i] = pw[i - 1] * (1 - p);
  for (int i = 1; i <= n; ++i) {
    f[i][0] = 1e18, f[i][1] = f[i - 1][0];
    for (int j = 2; j <= i; ++j) {
      f[i][j] = 1e18;
      for (int k = 1; k <= j; ++k) {
        double pr = (pw[k] - pw[j]) / (1 - pw[j]); // 选的 k 个没有的概率
        double val = pr * f[i - k][j - k] + (1 - pr) * f[i][k] + 1;
        if (val < f[i][j]) {
          f[i][j] = val, trans[i][j] = k;
        }
      }
    }
    for (int j = 1; j <= i; ++j) {
      double pr = pw[j];
      double val = pr * f[i - j][0] + (1 - pr) * f[i][j] + 1;
      if (val < f[i][0]) {
        f[i][0] = val, trans[i][0] = j;
      }
    }
  }
  std::cerr << f[n][0] << '\n';
}

int32_t main() {
  int T;
  scanf("%d %lf %d", &n, &p, &T);
  if (T > 1) prework();
  for (int i = 0; i < T; i++) {
    std::vector<bool> answer = find_positive(T > 1);
    assert(answer.size() == (size_t)n);

    std::string answer_str(n, ' ');
    for (int j = 0; j < n; j++) answer_str[j] = answer[j] ? '1' : '0';

    printf("A %s\n", answer_str.c_str());
    fflush(stdout);

    char verdict;
    scanf(" %c", &verdict);
    if (verdict == 'W') exit(0);
  }

  return 0;
}

詳細信息

Subtask #1:

score: 10
Accepted

Test #1:

score: 10
Accepted
time: 12ms
memory: 6160kb

input:

1000 0.789673 1
P
N
P
P
P
P
P
P
N
P
P
N
P
N
P
P
P
P
P
N
P
P
P
P
P
P
N
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
N
N
N
P
P
P
P
N
P
P
P
P
N
N
P
P
P
N
P
P
P
P
N
P
P
P
P
P
N
N
P
N
P
P
P
P
P
N
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
N
N
P
N
P
P
P
P
P
P
P
P
N
P
N
P
P
P
N
N
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
N
...

output:

Q 1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

points 1.0 1.0 translate:success

Test #2:

score: 10
Accepted
time: 0ms
memory: 5884kb

input:

1000 0.686378 1
N
P
N
N
N
P
N
N
P
N
P
P
N
N
P
P
P
P
N
P
P
P
N
P
P
P
N
N
P
N
P
P
P
N
N
N
P
N
P
P
P
N
P
P
P
P
P
P
N
N
P
P
P
N
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
N
N
P
P
N
N
N
P
P
N
P
N
P
P
P
P
P
N
P
N
N
P
P
P
N
P
N
N
P
N
P
P
P
P
N
P
N
P
P
P
P
N
P
P
N
P
P
P
N
P
N
P
P
N
P
N
N
P
P
N
P
N
P
P
N
N
P
N
N
P
...

output:

Q 1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

points 1.0 1.0 translate:success

Test #3:

score: 10
Accepted
time: 7ms
memory: 6168kb

input:

1000 0.873862 1
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
N
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
N
P
P
P
P
P
P
P
P
P
N
P
P
P
P
P
P
P
P
P
P
P
P
P
N
P
P
P
P
P
P
P
P
P
N
P
P
P
N
P
P
N
P
P
P
P
P
P
N
P
P
P
P
P
N
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
N
P
P
P
P
P
N
P
P
N
P
P
P
P
P
P
P
P
...

output:

Q 1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

points 1.0 1.0 translate:success

Test #4:

score: 10
Accepted
time: 4ms
memory: 5924kb

input:

1000 0.669578 1
P
P
N
P
P
P
P
P
N
P
N
P
P
P
N
P
P
P
P
P
P
P
N
P
P
P
P
N
N
P
N
P
N
P
P
N
P
P
N
P
P
N
P
N
P
P
P
P
P
P
P
P
P
P
P
P
P
N
N
P
P
N
P
P
N
N
P
P
N
N
P
N
P
N
P
N
P
P
N
N
P
P
P
P
P
P
P
P
P
P
N
P
P
N
P
P
N
P
P
P
P
P
P
N
P
P
P
P
N
N
N
P
N
P
P
N
P
P
N
N
P
P
N
P
P
P
N
P
P
N
P
P
P
P
P
N
P
P
N
P
P
P
...

output:

Q 1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

points 1.0 1.0 translate:success

Test #5:

score: 10
Accepted
time: 12ms
memory: 6124kb

input:

1000 0.907052 1
P
P
P
P
P
P
P
N
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
N
P
P
P
P
N
P
P
P
P
P
P
P
P
P
P
P
P
N
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
N
P
P
P
P
P
N
P
P
P
P
P
P
P
P
P
N
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
N
P
P
P
N
P
P
P
P
N
N
P
...

output:

Q 1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

points 1.0 1.0 translate:success

Test #6:

score: 10
Accepted
time: 0ms
memory: 6128kb

input:

1000 0.844418 1
P
P
P
P
P
P
P
P
P
P
P
P
N
P
P
P
P
P
P
N
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
N
P
P
P
P
P
N
P
P
P
N
P
P
P
P
P
N
P
P
P
P
P
P
N
P
P
P
N
P
N
P
P
N
P
P
P
N
P
P
N
P
P
P
N
N
N
P
P
P
P
N
N
P
N
N
P
P
P
P
P
P
P
N
P
N
P
P
P
P
N
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
...

output:

Q 1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

points 1.0 1.0 translate:success

Test #7:

score: 10
Accepted
time: 0ms
memory: 6028kb

input:

1000 0.533576 1
P
P
P
N
N
N
N
P
P
N
N
P
N
P
N
P
P
N
P
N
N
P
N
P
N
P
P
N
P
N
P
N
P
P
P
P
N
N
N
P
P
P
P
P
N
N
P
P
N
P
P
P
P
P
N
P
P
P
P
N
N
N
N
N
P
N
P
P
P
N
P
N
P
P
P
N
P
P
P
P
N
P
N
P
P
N
N
P
N
N
P
N
P
P
N
N
P
N
P
P
N
N
P
N
N
P
N
N
P
P
N
N
N
N
P
N
P
N
N
P
N
N
P
P
N
P
P
P
P
P
N
N
N
P
P
N
P
N
P
N
P
P
...

output:

Q 1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

points 1.0 1.0 translate:success

Test #8:

score: 10
Accepted
time: 3ms
memory: 5868kb

input:

1000 0.415944 1
N
N
N
N
N
N
N
P
N
N
P
N
N
P
N
P
N
N
N
P
N
N
N
N
N
N
N
N
N
P
N
N
N
N
P
P
P
P
N
P
N
N
P
N
N
P
N
N
P
P
N
P
P
P
N
N
P
N
P
N
N
N
N
N
P
N
P
N
P
N
P
N
N
N
P
N
N
N
N
P
N
N
P
P
P
P
P
N
N
N
P
P
N
N
N
P
N
N
P
N
P
P
P
N
P
P
N
P
P
P
N
P
N
P
P
P
P
P
N
N
N
P
P
P
P
P
P
P
P
N
N
N
P
P
N
N
N
N
N
N
P
P
...

output:

Q 1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

points 1.0 1.0 translate:success

Test #9:

score: 10
Accepted
time: 12ms
memory: 5880kb

input:

1000 0.596017 1
P
N
P
P
N
N
P
N
N
P
P
P
N
P
N
N
P
P
P
N
P
N
P
N
N
N
P
N
N
P
N
N
P
N
P
P
P
N
P
P
N
P
P
P
N
P
N
P
P
P
N
P
N
N
P
P
P
N
P
N
N
N
P
N
N
N
P
P
P
N
P
P
P
N
N
P
N
N
P
P
N
N
P
N
P
N
N
P
N
N
P
N
P
P
N
N
P
P
P
P
N
P
P
P
N
N
P
P
P
P
P
P
N
P
P
P
N
P
P
N
P
P
P
P
P
P
P
P
N
P
P
P
P
N
N
P
P
P
N
P
N
P
...

output:

Q 1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

points 1.0 1.0 translate:success

Test #10:

score: 10
Accepted
time: 6ms
memory: 5808kb

input:

1000 0.157686 1
N
N
N
N
N
N
N
N
N
N
N
N
N
P
N
N
N
P
P
N
N
P
N
N
N
N
P
N
N
N
N
N
N
N
N
N
N
N
P
N
N
N
P
P
N
N
P
N
P
N
N
N
N
N
P
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
P
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
P
P
N
N
N
N
N
N
N
P
P
N
N
N
N
N
N
N
N
N
P
P
P
P
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
P
N
N
P
N
N
N
N
N
P
N
...

output:

Q 1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

points 1.0 1.0 translate:success

Test #11:

score: 10
Accepted
time: 6ms
memory: 5860kb

input:

1000 0.380215 1
N
N
N
P
N
N
N
P
N
N
P
N
N
N
P
P
N
P
N
N
N
P
P
P
N
P
P
N
N
N
P
N
N
N
P
N
N
N
P
P
P
P
N
N
N
N
N
P
P
N
N
N
N
N
N
N
N
N
N
N
N
N
N
P
P
N
N
N
N
P
P
N
N
N
P
N
N
N
N
N
P
N
P
N
N
P
N
N
N
N
P
N
N
N
N
P
P
P
P
P
P
P
N
N
N
N
N
N
N
N
N
N
P
N
N
P
N
N
N
P
N
N
N
N
N
N
N
N
N
P
N
P
N
P
N
N
P
P
N
N
P
P
...

output:

Q 1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

points 1.0 1.0 translate:success

Test #12:

score: 10
Accepted
time: 0ms
memory: 5932kb

input:

1000 0.432565 1
P
N
P
N
N
P
N
N
N
P
P
P
N
P
P
N
N
N
N
N
N
N
N
N
P
P
P
N
P
P
N
N
P
P
P
P
N
P
P
N
N
N
N
P
P
P
P
N
P
N
N
P
P
P
N
N
N
N
P
N
P
N
P
N
P
N
P
P
N
N
P
N
N
P
N
N
N
P
N
P
N
N
N
P
N
N
P
N
P
N
N
N
P
N
N
P
P
P
P
P
P
N
P
N
N
N
N
N
N
N
P
P
N
P
N
N
N
N
P
P
P
N
P
N
N
P
P
P
N
P
P
P
P
P
P
N
P
N
P
P
N
P
...

output:

Q 1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

points 1.0 1.0 translate:success

Test #13:

score: 10
Accepted
time: 12ms
memory: 6160kb

input:

1000 0.509199 1
P
P
N
P
N
N
N
P
P
N
N
N
N
N
P
N
N
P
P
N
P
P
N
P
P
P
P
P
N
N
P
N
P
P
N
P
P
P
P
P
P
P
P
P
P
N
P
P
P
N
N
P
N
P
P
N
P
N
P
N
N
P
N
P
N
P
N
N
N
N
N
P
P
N
N
N
P
P
P
N
N
P
P
P
P
N
N
N
N
P
P
N
P
N
N
N
P
P
P
P
P
N
N
N
P
P
N
P
P
N
P
N
P
P
P
N
N
P
P
N
N
N
N
N
N
P
P
P
N
N
P
P
N
N
N
N
N
N
P
P
N
N
...

output:

Q 1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

points 1.0 1.0 translate:success

Test #14:

score: 10
Accepted
time: 5ms
memory: 5992kb

input:

1000 0.381646 1
N
N
N
P
N
N
N
N
P
P
P
N
N
N
N
N
P
N
N
N
P
N
P
N
P
N
P
N
N
N
N
N
N
N
P
P
N
N
N
N
P
P
N
N
N
N
N
P
N
N
N
N
P
N
P
N
N
N
N
P
P
P
N
P
P
N
P
P
P
N
P
N
P
P
P
N
N
N
N
N
P
N
N
P
P
N
P
P
N
P
P
N
N
N
N
P
P
N
N
P
N
N
N
N
N
P
N
N
P
P
N
N
N
N
N
P
P
N
P
N
N
P
N
N
N
P
P
N
N
P
N
N
N
N
P
P
N
N
N
N
N
P
...

output:

Q 1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

points 1.0 1.0 translate:success

Test #15:

score: 10
Accepted
time: 4ms
memory: 5960kb

input:

1000 0.42815 1
N
P
P
N
P
N
P
P
P
N
N
P
N
N
P
N
N
P
P
P
N
N
N
N
P
P
P
N
N
N
P
P
N
P
N
N
P
N
N
N
P
P
N
N
N
N
P
N
N
P
P
N
P
N
N
N
N
P
N
N
N
N
N
P
N
P
P
N
P
P
P
P
N
N
N
P
P
P
N
P
P
P
N
P
P
N
P
N
N
N
P
N
N
P
N
N
P
P
N
P
P
N
N
P
N
N
P
P
P
P
P
P
P
N
N
N
P
N
P
N
P
N
N
N
N
N
N
N
P
N
N
N
P
N
P
P
P
P
N
N
N
P
N...

output:

Q 1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

points 1.0 1.0 translate:success

Test #16:

score: 10
Accepted
time: 0ms
memory: 5924kb

input:

1000 1 1
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P...

output:

Q 1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

points 1.0 1.0 translate:success

Test #17:

score: 10
Accepted
time: 4ms
memory: 5864kb

input:

1000 0 1
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N...

output:

Q 1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

points 1.0 1.0 translate:success

Subtask #2:

score: 43.14
Acceptable Answer

Test #18:

score: 90
Accepted
time: 287ms
memory: 15392kb

input:

1000 0.001 300
N
N
C
N
P
N
P
P
N
N
N
N
P
P
P
N
C
P
P
P
N
P
N
P
P
N
N
P
P
P
P
P
P
N
N
N
N
N
P
P
N
N
N
P
P
P
N
N
N
N
P
N
C
N
N
C
N
N
C
P
P
N
N
P
N
N
N
P
P
P
N
C
N
P
N
N
P
P
N
P
N
N
P
P
N
C
N
N
C
N
N
C
N
P
P
P
P
P
N
N
N
P
P
N
C
N
N
C
P
P
P
P
N
N
N
N
P
N
P
P
N
N
N
N
N
P
N
P
P
P
N
P
N
C
P
P
P
P
P
N
P
P
P...

output:

Q 0111100001110011010101000001000110111010101001100111111001111101110010100110100011001110001000001100000011100011110010101111110111110111011000110111101100101111000011101011001000110111000111100001000110111001010010101100100110111010100000110100001111011011010101101101110001001000110110010001010110...

result:

points 1.0 1.0 Output is correct (P=0.001, F=15.1, Q=11.8) -> 90.00 points

Test #19:

score: 87.93
Acceptable Answer
time: 363ms
memory: 15844kb

input:

1000 0.005256 300
N
N
N
P
N
P
N
N
N
N
N
P
N
P
P
P
P
P
N
P
P
P
P
P
N
P
P
P
P
N
P
N
P
N
P
P
P
N
N
N
P
P
N
P
N
P
N
P
P
P
N
C
N
N
N
P
N
P
P
N
N
N
P
P
N
P
P
P
P
P
P
N
P
P
P
N
P
N
P
P
P
N
P
N
N
C
P
N
N
N
P
P
N
N
P
N
N
N
N
N
N
N
C
N
N
N
N
N
P
P
N
P
P
N
P
P
P
P
P
P
P
P
P
N
N
P
N
P
N
P
N
P
P
P
N
P
P
N
N
P
P
...

output:

Q 0001000000000000010000100000000000100100000001000001000000000000000000100000000000001000010000000010000000000000000000000100000000000000000100100000000000000000001000000000010000000011000000000100000100000000000000000000000000001010010010000000000000000000000100000001000000001000100000000001000000...

result:

points 0.9770 0.977 Output is correct (P=0.005256, F=51.1, Q=51.4) -> 87.93 points

Test #20:

score: 69.5
Acceptable Answer
time: 474ms
memory: 15748kb

input:

1000 0.011546 300
N
N
P
P
P
N
P
P
N
P
P
N
P
N
P
P
P
P
N
N
P
N
N
P
P
P
P
P
P
N
P
N
N
N
P
P
N
P
N
N
P
P
N
P
P
P
N
P
N
N
P
P
P
N
N
P
P
N
P
N
N
N
P
P
N
N
P
P
N
N
P
P
P
N
P
N
P
N
P
P
P
P
N
P
N
N
P
P
P
P
N
P
N
P
P
P
N
P
N
N
N
N
P
N
N
N
N
C
N
N
N
N
P
P
P
N
N
P
N
P
N
N
N
N
N
N
N
P
N
N
P
N
P
P
P
N
N
N
P
P
N
...

output:

Q 0010000000100000010000000000000000000001100010000000000000000100000000000000000000110000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000010000000000000010000000000000000100000000000000000000000100000000000000000000100001...

result:

points 0.77222222220 0.7722222222 Output is correct (P=0.011546, F=94.9, Q=101.9) -> 69.50 points

Test #21:

score: 59.45
Acceptable Answer
time: 702ms
memory: 15996kb

input:

1000 0.028545 300
P
N
P
P
N
P
P
N
N
N
P
P
N
P
N
P
P
P
N
N
N
P
P
P
P
P
N
P
P
N
P
N
P
P
P
P
N
N
P
N
N
P
N
P
N
P
N
P
P
P
N
P
N
N
N
P
N
P
P
P
N
N
N
P
N
P
N
P
P
P
N
P
N
P
N
N
N
P
P
P
P
N
N
P
P
N
P
N
P
P
N
N
N
P
P
P
N
N
N
P
N
N
P
P
N
N
P
P
N
P
N
P
P
N
P
P
N
P
P
N
P
P
P
P
N
P
P
N
N
P
P
P
N
N
P
P
P
P
P
P
N
...

output:

Q 0000010000000000000010000000000000000000000100000000000000001000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000...

result:

points 0.66055555560 0.6605555556 Output is correct (P=0.028545, F=191.5, Q=216.1) -> 59.45 points

Test #22:

score: 55.93
Acceptable Answer
time: 827ms
memory: 16192kb

input:

1000 0.039856 300
P
P
N
P
P
P
N
P
P
P
P
N
P
N
N
P
P
P
P
N
P
P
P
P
P
P
P
P
P
N
N
P
P
N
P
N
P
N
N
P
N
N
P
N
P
N
P
P
N
N
N
P
N
N
N
P
P
P
P
P
N
N
P
N
P
N
P
P
N
P
P
P
P
P
N
P
P
N
P
N
N
P
P
N
P
P
P
P
N
P
P
N
N
P
P
P
P
P
N
N
P
N
P
N
P
P
N
P
P
P
P
N
P
P
N
N
N
N
N
P
N
N
P
P
P
P
N
P
N
N
P
P
P
P
N
N
P
N
N
N
P
...

output:

Q 0000000010000000000000000000000000000000000001000010000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

points 0.62144444440 0.6214444444 Output is correct (P=0.039856, F=246.3, Q=283.8) -> 55.93 points

Test #23:

score: 51.9
Acceptable Answer
time: 1054ms
memory: 16848kb

input:

1000 0.068648 300
N
P
N
N
P
N
P
P
P
N
N
P
P
N
N
N
P
P
N
P
P
N
N
P
N
P
P
P
N
P
N
P
N
N
P
N
P
P
P
P
N
P
N
N
N
P
P
N
P
P
P
N
N
N
P
P
P
P
P
N
P
P
P
N
P
P
N
P
P
N
N
P
N
N
N
P
P
N
N
P
P
N
N
N
P
P
P
N
P
P
P
N
P
N
P
N
P
N
P
P
P
N
P
P
P
N
P
P
P
N
P
N
P
N
P
N
P
P
P
P
P
N
P
P
N
N
P
P
N
N
P
N
P
P
N
P
P
N
N
N
P
...

output:

Q 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

points 0.57666666670 0.5766666667 Output is correct (P=0.068648, F=366.2, Q=433.4) -> 51.90 points

Test #24:

score: 49.04
Acceptable Answer
time: 1383ms
memory: 17828kb

input:

1000 0.104571 300
P
P
P
P
N
N
N
N
P
N
N
P
P
P
N
P
P
P
P
P
P
P
N
P
N
N
N
P
N
P
P
P
P
N
N
P
N
N
N
P
N
P
N
P
P
P
P
N
P
P
P
P
N
P
P
P
P
N
P
P
P
N
P
P
P
P
P
N
P
N
P
P
N
P
P
P
N
P
N
P
P
P
P
N
P
N
P
N
N
N
N
N
P
P
N
P
N
P
P
P
P
P
P
P
P
N
N
N
P
N
N
P
P
P
N
P
N
P
N
P
N
P
N
P
N
P
N
P
N
P
N
P
N
P
P
P
N
N
N
P
N
...

output:

Q 0000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

points 0.54488888890 0.5448888889 Output is correct (P=0.104571, F=490.3, Q=592.7) -> 49.04 points

Test #25:

score: 46.21
Acceptable Answer
time: 1653ms
memory: 18036kb

input:

1000 0.158765 300
P
N
P
P
N
N
P
P
N
P
P
P
N
P
P
N
P
P
N
P
N
P
P
N
N
N
N
P
N
N
P
P
P
P
P
P
P
N
P
N
P
P
N
P
N
P
P
P
P
N
P
P
P
P
N
P
P
N
P
P
N
P
P
P
N
N
P
P
P
N
P
N
N
N
N
P
N
P
P
P
P
N
P
N
P
N
N
P
N
N
N
P
P
P
P
N
P
P
P
P
P
P
P
P
N
N
P
P
P
P
N
N
P
P
P
P
P
N
N
P
N
P
N
N
P
P
N
P
P
P
P
P
P
N
N
P
P
N
P
P
P
...

output:

Q 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

points 0.51344444440 0.5134444444 Output is correct (P=0.158765, F=639.1, Q=790.5) -> 46.21 points

Test #26:

score: 43.14
Acceptable Answer
time: 1970ms
memory: 18076kb

input:

1000 0.2 300
P
P
P
N
N
P
N
P
P
N
N
N
N
N
N
N
N
N
N
P
P
P
N
P
P
P
N
N
P
N
P
P
N
N
P
P
P
P
N
P
P
N
P
P
P
P
N
P
P
N
P
P
P
P
N
P
P
N
N
N
P
P
P
N
P
N
P
P
N
N
P
P
P
P
P
P
N
N
P
N
P
P
P
P
P
N
N
N
N
P
P
P
N
N
N
N
N
P
N
N
P
N
N
P
N
P
P
N
N
P
P
P
P
N
P
P
N
N
N
N
N
N
P
N
N
P
N
P
N
P
P
P
P
P
P
P
P
N
P
P
P
P
P
P...

output:

Q 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

points 0.47933333330 0.4793333333 Output is correct (P=0.2, F=731.4, Q=930.0) -> 43.14 points