QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#580016#9162. COVID testsliuziao53.09 2046ms18288kbC++233.4kb2024-09-21 19:45:012024-09-21 19:45:02

Judging History

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

  • [2024-09-21 19:45:02]
  • 评测
  • 测评结果:53.09
  • 用时:2046ms
  • 内存:18288kb
  • [2024-09-21 19:45:01]
  • 提交

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 = a - k; i < a; ++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 = b - k; i < b; ++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] = 1e9, 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;
      }
    }
  }
}

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: 5ms
memory: 5896kb

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: 7ms
memory: 5788kb

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: 5ms
memory: 5840kb

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: 5ms
memory: 5920kb

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: 6ms
memory: 6128kb

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: 9ms
memory: 5860kb

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: 3ms
memory: 5836kb

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: 5ms
memory: 5844kb

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: 8ms
memory: 5920kb

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: 7ms
memory: 5840kb

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: 4ms
memory: 6092kb

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: 5912kb

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: 11ms
memory: 5832kb

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: 0ms
memory: 6088kb

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: 2ms
memory: 6112kb

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: 1ms
memory: 5896kb

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: 0ms
memory: 5960kb

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.09
Acceptable Answer

Test #18:

score: 90
Accepted
time: 299ms
memory: 15588kb

input:

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

output:

Q 0101101110101011010010010100100101101010001010000000000010001001111111110110100101001011101011100100000100111000001010011000111111111101011001111001000011000101110001000011100001000011000011101111101111010111001010101110101001111101101010011001011010111101110110001011101001111011011111101010101010...

result:

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

Test #19:

score: 87.93
Acceptable Answer
time: 385ms
memory: 16136kb

input:

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

output:

Q 0111001100110000000000101001000000100000010000010100000100010000000000000010000010100010000000000000010000010100000000000001010001000000100000000001000000000000000000001000100010000010000100000000000000000100000000000000000000000010000000000000000000010101000010000000001000001000000101010000000010...

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: 463ms
memory: 16272kb

input:

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

output:

Q 0000000000000000000000000100000000000000000000000000100001000000000000101000000000100000000000000000010000110001100000000000000000100000000000000100000000000000000000000000000000000000000000000000000100000000000000000000000000000000000001000000010000000000000000100000000000000000000000000000100000...

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: 726ms
memory: 16512kb

input:

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

output:

Q 0000000000000000000000000000000000000000000000011000000000000000001000000000000010000000000000000000000000000000001000000000000000000000000000000000000010000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000100000...

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.82
Acceptable Answer
time: 791ms
memory: 16208kb

input:

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

output:

Q 0000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000100010000000000000000000000000000000010000000010000000000000000000000000000000010000000010000000000000000000000000000000...

result:

points 0.62022222220 0.6202222222 Output is correct (P=0.039856, F=246.3, Q=284.0) -> 55.82 points

Test #23:

score: 51.9
Acceptable Answer
time: 1130ms
memory: 16908kb

input:

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

output:

Q 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000110000000000000000000000000000000000000000010000000000000000000000...

result:

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

Test #24:

score: 48.97
Acceptable Answer
time: 1596ms
memory: 17264kb

input:

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

output:

Q 0000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

points 0.54411111110 0.5441111111 Output is correct (P=0.104571, F=490.3, Q=593.0) -> 48.97 points

Test #25:

score: 46.26
Acceptable Answer
time: 1693ms
memory: 17788kb

input:

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

output:

Q 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

points 0.5140 0.514 Output is correct (P=0.158765, F=639.1, Q=790.2) -> 46.26 points

Test #26:

score: 43.09
Acceptable Answer
time: 2046ms
memory: 18288kb

input:

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

output:

Q 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

points 0.47877777780 0.4787777778 Output is correct (P=0.2, F=731.4, Q=930.5) -> 43.09 points