Submission #809413

# Submission time Handle Problem Language Result Execution time Memory
809413 2023-08-06T01:27:47 Z hgmhc Parrots (IOI11_parrots) C++17
81 / 100
4 ms 1160 KB
#include "encoder.h"
#include "encoderlib.h"
#include <bits/stdc++.h>
using namespace std;

void encode(int n, int a[])
{
  for (int i = 0; i < n; ++i) { // n:5bit, m:8bit, s:8bit
    // j:3bit * 10
    for (int j = 0; j < 8; ++j) {
      if (a[i]>>j&1) send((i<<3)|j);
    }
  }
}
#include "decoder.h"
#include "decoderlib.h"
#include <bits/stdc++.h>
using namespace std;

const int N = 32;

void decode(int n, int l, int x[])
{
  int ans[N]{};
  for (int k = 0; k < l; ++k) {
    int i = x[k]>>3;
    int j = x[k]&0b111;
    ans[i] |= 1<<j;
  }
  for (int i = 0; i < n; ++i)
    output(ans[i]);
}
// g++-13 grader.cpp encoder.cpp decoder.cpp -o par && ./par < grader.in.1
# Verdict Execution time Memory Grader output
1 Correct 1 ms 640 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 1028 KB Output is correct
2 Correct 2 ms 1012 KB Output is correct
3 Correct 2 ms 1032 KB Output is correct
4 Correct 2 ms 1036 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 1024 KB Output is correct
2 Correct 2 ms 1160 KB Output is correct
3 Correct 1 ms 1032 KB Output is correct
4 Correct 2 ms 1044 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 1080 KB Output is correct
2 Correct 2 ms 1036 KB Output is correct
3 Correct 3 ms 1044 KB Output is correct
4 Correct 3 ms 1048 KB Output is correct
5 Correct 4 ms 1040 KB Output is correct
6 Correct 3 ms 1100 KB Output is correct
# Verdict Execution time Memory Grader output
1 Partially correct 3 ms 1036 KB Output is partially correct - P = 8.000000
2 Partially correct 3 ms 1052 KB Output is partially correct - P = 8.000000
3 Incorrect 1 ms 572 KB Error : Bad encoded integer
4 Incorrect 2 ms 644 KB Error : Bad encoded integer
5 Incorrect 0 ms 512 KB Error : Bad encoded integer
6 Incorrect 1 ms 572 KB Error : Bad encoded integer
7 Incorrect 0 ms 512 KB Error : Bad encoded integer