QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#604329#9237. Messagebykem100 ✓194ms4068kbC++201.4kb2024-10-02 09:44:382024-10-02 09:44:39

Judging History

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

  • [2024-10-02 09:44:39]
  • 评测
  • 测评结果:100
  • 用时:194ms
  • 内存:4068kb
  • [2024-10-02 09:44:38]
  • 提交

answer

#include "message.h"

using std::vector;

void send_message(vector<bool> M, vector<bool> C) {
  vector<int> d(31, 0);
  for (int i = 0; i < 31; ++i) {
    if (!C[i]) {
      int k = 1;
      for (; C[(i + k) % 31]; ++k) {
      }
      d[i] = k;
    }
  }
  M.push_back(1);
  for (; M.size() < 1025; M.push_back(0)) {
  }
  int c = 0;
  for (int i = 0; i < 66; ++i) {
    vector<bool> r(31, 0);
    for (int j = 0; j < 31; ++j) {
      if (!C[j]) {
        if (d[j]) {
          r[j] = !--d[j];
        } else {
          r[j] = M[c++];
        }
      }
    }
    send_packet(r);
  }
}
vector<bool> receive_message(vector<vector<bool>> R) {
  vector<int> d(31, 0);
  for (int i = 0; i < 66; ++i) {
    for (int j = 0; j < 31; ++j) {
      if (!d[j] && R[i][j]) {
        d[j] = i + 1;
      }
    }
  }
  for (int i = 0; i < 31; ++i) {
    if (d[i] >= 31) {
      d[i] = 0;
    }
  }
  vector<int> l;
  for (int s = 0; s < 31; ++s) {
    l.clear();
    int x = s;
    for (int i = 0; i < 16 && (!i || x != s); ++i, x = (x + d[x]) % 31) {
      l.push_back(x);
    }
    if (l.size() == 16 && x == s) {
      break;
    }
  }
  vector<bool> M;
  for (int i = 0; i < 66; ++i) {
    for (int j : l) {
      if (i >= d[j]) {
        M.push_back(R[i][j]);
      }
    }
  }
  for (; !M.back(); M.pop_back()) {
  }
  M.pop_back();
  return M;
}

详细

Subtask #1:

score: 10
Accepted

Test #1:

score: 10
Accepted
time: 129ms
memory: 3968kb

Manager to Aisha


Aisha to Manager


Manager to Basma


Basma to Manager


Manager to Checker

1

result:

points 1.0

Test #2:

score: 10
Accepted
time: 139ms
memory: 3996kb

Manager to Aisha


Aisha to Manager


Manager to Basma


Basma to Manager


Manager to Checker

1

result:

points 1.0

Test #3:

score: 10
Accepted
time: 169ms
memory: 3824kb

Manager to Aisha


Aisha to Manager


Manager to Basma


Basma to Manager


Manager to Checker

1

result:

points 1.0

Test #4:

score: 10
Accepted
time: 148ms
memory: 3744kb

Manager to Aisha


Aisha to Manager


Manager to Basma


Basma to Manager


Manager to Checker

1

result:

points 1.0

Test #5:

score: 10
Accepted
time: 98ms
memory: 3824kb

Manager to Aisha


Aisha to Manager


Manager to Basma


Basma to Manager


Manager to Checker

1

result:

points 1.0

Test #6:

score: 10
Accepted
time: 91ms
memory: 3820kb

Manager to Aisha


Aisha to Manager


Manager to Basma


Basma to Manager


Manager to Checker

1

result:

points 1.0

Test #7:

score: 10
Accepted
time: 112ms
memory: 3816kb

Manager to Aisha


Aisha to Manager


Manager to Basma


Basma to Manager


Manager to Checker

1

result:

points 1.0

Subtask #2:

score: 90
Accepted

Test #8:

score: 90
Accepted
time: 158ms
memory: 4000kb

Manager to Aisha


Aisha to Manager


Manager to Basma


Basma to Manager


Manager to Checker

1

result:

points 1.0

Test #9:

score: 90
Accepted
time: 182ms
memory: 3996kb

Manager to Aisha


Aisha to Manager


Manager to Basma


Basma to Manager


Manager to Checker

1

result:

points 1.0

Test #10:

score: 90
Accepted
time: 194ms
memory: 3964kb

Manager to Aisha


Aisha to Manager


Manager to Basma


Basma to Manager


Manager to Checker

1

result:

points 1.0

Test #11:

score: 90
Accepted
time: 187ms
memory: 3828kb

Manager to Aisha


Aisha to Manager


Manager to Basma


Basma to Manager


Manager to Checker

1

result:

points 1.0

Test #12:

score: 90
Accepted
time: 169ms
memory: 3816kb

Manager to Aisha


Aisha to Manager


Manager to Basma


Basma to Manager


Manager to Checker

1

result:

points 1.0

Test #13:

score: 90
Accepted
time: 114ms
memory: 3804kb

Manager to Aisha


Aisha to Manager


Manager to Basma


Basma to Manager


Manager to Checker

1

result:

points 1.0

Test #14:

score: 90
Accepted
time: 81ms
memory: 3828kb

Manager to Aisha


Aisha to Manager


Manager to Basma


Basma to Manager


Manager to Checker

1

result:

points 1.0

Test #15:

score: 90
Accepted
time: 144ms
memory: 3816kb

Manager to Aisha


Aisha to Manager


Manager to Basma


Basma to Manager


Manager to Checker

1

result:

points 1.0

Test #16:

score: 90
Accepted
time: 120ms
memory: 4068kb

Manager to Aisha


Aisha to Manager


Manager to Basma


Basma to Manager


Manager to Checker

1

result:

points 1.0

Test #17:

score: 90
Accepted
time: 162ms
memory: 3820kb

Manager to Aisha


Aisha to Manager


Manager to Basma


Basma to Manager


Manager to Checker

1

result:

points 1.0

Test #18:

score: 90
Accepted
time: 178ms
memory: 3820kb

Manager to Aisha


Aisha to Manager


Manager to Basma


Basma to Manager


Manager to Checker

1

result:

points 1.0

Test #19:

score: 90
Accepted
time: 175ms
memory: 3820kb

Manager to Aisha


Aisha to Manager


Manager to Basma


Basma to Manager


Manager to Checker

1

result:

points 1.0

Test #20:

score: 90
Accepted
time: 124ms
memory: 3992kb

Manager to Aisha


Aisha to Manager


Manager to Basma


Basma to Manager


Manager to Checker

1

result:

points 1.0

Test #21:

score: 90
Accepted
time: 170ms
memory: 4000kb

Manager to Aisha


Aisha to Manager


Manager to Basma


Basma to Manager


Manager to Checker

1

result:

points 1.0

Test #22:

score: 90
Accepted
time: 158ms
memory: 3996kb

Manager to Aisha


Aisha to Manager


Manager to Basma


Basma to Manager


Manager to Checker

1

result:

points 1.0

Test #23:

score: 90
Accepted
time: 181ms
memory: 3772kb

Manager to Aisha


Aisha to Manager


Manager to Basma


Basma to Manager


Manager to Checker

1

result:

points 1.0

Test #24:

score: 90
Accepted
time: 192ms
memory: 3832kb

Manager to Aisha


Aisha to Manager


Manager to Basma


Basma to Manager


Manager to Checker

1

result:

points 1.0

Test #25:

score: 90
Accepted
time: 150ms
memory: 3812kb

Manager to Aisha


Aisha to Manager


Manager to Basma


Basma to Manager


Manager to Checker

1

result:

points 1.0

Test #26:

score: 90
Accepted
time: 137ms
memory: 3716kb

Manager to Aisha


Aisha to Manager


Manager to Basma


Basma to Manager


Manager to Checker

1

result:

points 1.0

Test #27:

score: 90
Accepted
time: 141ms
memory: 3828kb

Manager to Aisha


Aisha to Manager


Manager to Basma


Basma to Manager


Manager to Checker

1

result:

points 1.0

Extra Test:

score: 0
Extra Test Passed