QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#580029#9162. COVID testsliuziao53.09 1887ms18344kbC++233.4kb2024-09-21 19:48:142024-09-21 19:48:15

Judging History

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

  • [2024-09-21 19:48:15]
  • 评测
  • 测评结果:53.09
  • 用时:1887ms
  • 内存:18344kb
  • [2024-09-21 19:48:14]
  • 提交

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] = 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;
      }
    }
  }
}

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;
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 10
Accepted

Test #1:

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

input:

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

output:

Q 1000001000001111111110001011111110110001101001111100100100010100001111111011100101111000000001010110101111111010011100101111010011000000010111100001011011001000000110001001110000110011011101010000111111100011100110001100011100010110010101101011101100010110011100001100110110110101110101010100001010...

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.27
Acceptable Answer
time: 377ms
memory: 15656kb

input:

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

output:

Q 0000000000000010000000000001000111110000000001000001000000100000000000000100000000100000000000000000100100001000000000000000000000000000010110000000001010001000000000000000000100000000100010000000001010000000000000010100000000000000000001100000000000000000000000100100000000010000000000000000000000...

result:

points 0.96966666670 0.9696666667 Output is correct (P=0.005256, F=51.1, Q=51.5) -> 87.27 points

Test #20:

score: 69.5
Acceptable Answer
time: 462ms
memory: 16420kb

input:

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

output:

Q 0000000000000000000000000001000000000000000000000000000000000000000000000000000000000000001000100000000100000001000000000000000001000000000000000000000100000000101000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000...

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.37
Acceptable Answer
time: 680ms
memory: 16372kb

input:

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

output:

Q 0000000000000000000000000000000000000000000000000000000000010010000000000000000000000000000000000000000000000000001000000000000000001000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000...

result:

points 0.65966666670 0.6596666667 Output is correct (P=0.028545, F=191.5, Q=216.2) -> 59.37 points

Test #22:

score: 56.05
Acceptable Answer
time: 881ms
memory: 16364kb

input:

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

output:

Q 0000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000010000000000000000100000000000...

result:

points 0.62277777780 0.6227777778 Output is correct (P=0.039856, F=246.3, Q=283.6) -> 56.05 points

Test #23:

score: 51.94
Acceptable Answer
time: 1085ms
memory: 16696kb

input:

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

output:

Q 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000100000000000001000000000000000000000000000000000000000000000000...

result:

points 0.57711111110 0.5771111111 Output is correct (P=0.068648, F=366.2, Q=433.3) -> 51.94 points

Test #24:

score: 48.99
Acceptable Answer
time: 1491ms
memory: 17164kb

input:

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

output:

Q 0000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

points 0.54433333330 0.5443333333 Output is correct (P=0.104571, F=490.3, Q=592.9) -> 48.99 points

Test #25:

score: 46.23
Acceptable Answer
time: 1746ms
memory: 18024kb

input:

1000 0.158765 300
P
N
P
P
N
N
P
N
N
P
N
N
N
P
N
P
P
N
P
P
P
P
N
P
N
P
P
P
P
P
P
N
N
P
P
N
P
N
N
P
P
N
P
N
P
P
P
P
N
P
N
P
P
P
P
N
P
N
P
P
N
P
P
N
P
P
N
N
P
P
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
P
P
P
P
N
P
N
N
P
N
N
N
P
P
P
P
P
P
N
P
P
N
N
P
N
N
P
N
N
P
P
P
P
P
N
N
N
P
N
N
P
N
N
P
...

output:

Q 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

points 0.51366666670 0.5136666667 Output is correct (P=0.158765, F=639.1, Q=790.4) -> 46.23 points

Test #26:

score: 43.09
Acceptable Answer
time: 1887ms
memory: 18344kb

input:

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

output:

Q 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

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