QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#580077#9162. COVID testsliuziao100 ✓1702ms18484kbC++233.4kb2024-09-21 19:59:352024-09-21 19:59:36

Judging History

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

  • [2024-09-21 19:59:36]
  • 评测
  • 测评结果:100
  • 用时:1702ms
  • 内存:18484kb
  • [2024-09-21 19:59:35]
  • 提交

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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: 90
Accepted

Test #18:

score: 90
Accepted
time: 302ms
memory: 15848kb

input:

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

output:

Q 1101101010001101111100100110101001010111101011111000110110010000100001000001101000010111011110101100010001101010111010011111111111101100011011011011001010101110110101110100011110011010001101100000101010000111111011011100000010001100010100111011100001011000111101011011101110111010001111101010100100...

result:

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

Test #19:

score: 90
Accepted
time: 349ms
memory: 16348kb

input:

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

output:

Q 0000000001000101000000000000000000000000000100101010000000000000000011100000001000000001000010000000010100000000010000000000100000000000000000000000000000001000100010000000001000000000000000000001000000100011000000010100000000000000000100000110000000000000000010000001100000101000000100000100100010...

result:

points 1.0 1.0 Output is correct (P=0.005256, F=51.1, Q=46.3) -> 90.00 points

Test #20:

score: 90
Accepted
time: 455ms
memory: 15704kb

input:

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

output:

Q 0000000000000000000000000100000000010000000000000000000000000000010000000000001000000010000010000100010000000000000000000000000010000000000000000000000000010000000010000000100000000000000100000010000000000000000100000000000101000000000000000000000000001000000001000000000000000000000100000000000000...

result:

points 1.0 1.0 Output is correct (P=0.011546, F=94.9, Q=90.5) -> 90.00 points

Test #21:

score: 90
Accepted
time: 687ms
memory: 16248kb

input:

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

output:

Q 0000000000000000000000000000000000000000000000000000000000000000100000000000000000000100000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000010000000010000000000000000000000000000000000000000000000000000000...

result:

points 1.0 1.0 Output is correct (P=0.028545, F=191.5, Q=187.8) -> 90.00 points

Test #22:

score: 90
Accepted
time: 723ms
memory: 16312kb

input:

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

output:

Q 0000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000001000000000010000000000000000000000010000000000000001000000000000000000000000001000000000000000000000000000000000000000000000000000000000001000000000000000000000000...

result:

points 1.0 1.0 Output is correct (P=0.039856, F=246.3, Q=243.8) -> 90.00 points

Test #23:

score: 90
Accepted
time: 960ms
memory: 16928kb

input:

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

output:

Q 0000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010010000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

points 1.0 1.0 Output is correct (P=0.068648, F=366.2, Q=364.2) -> 90.00 points

Test #24:

score: 90
Accepted
time: 1268ms
memory: 17848kb

input:

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

output:

Q 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

points 1.0 1.0 Output is correct (P=0.104571, F=490.3, Q=488.0) -> 90.00 points

Test #25:

score: 90
Accepted
time: 1481ms
memory: 17428kb

input:

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

output:

Q 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

points 1.0 1.0 Output is correct (P=0.158765, F=639.1, Q=632.7) -> 90.00 points

Test #26:

score: 90
Accepted
time: 1702ms
memory: 18484kb

input:

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

output:

Q 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

points 1.0 1.0 Output is correct (P=0.2, F=731.4, Q=729.5) -> 90.00 points

Extra Test:

score: 0
Extra Test Passed