Submission #796007

# Submission time Handle Problem Language Result Execution time Memory
796007 2023-07-28T04:08:39 Z hgmhc Parrots (IOI11_parrots) C++17
52 / 100
3 ms 1080 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) {
    // cerr << a[i] << " -> {";
    for (int j = 0; j < 4; ++j) {
      send(i | (j << 4) | ((a[i]>>(2*j)&0b11) << 6));
      // cerr << (j?", ":"")<< bitset<2>((a[i]>>(2*j)&0b11));
    }
    // cerr<<"}\n";
  }
}

// send에 8bit 표현
// a[i] < 2^8
// ?? / ?? / ?? / ??
// 00 / 01 / 10 / 11
// 4bit + (2+2)bit
#include "decoder.h"
#include "decoderlib.h"
#include <bits/stdc++.h>
using namespace std;

static const int N = 20;
static int ans[N];

void decode(int n, int l, int x[])
{
  fill(ans,ans+N,0);
  for (int k = 0; k < l; ++k) {
    int i = x[k]&0b1111;
    int j = x[k]>>4&0b11;
    int v = x[k]>>6&0b11;
    ans[i] |= v<<(2*j);
    // cerr << bitset<4>(i) << ' ' << bitset<2>(j) << ' ' << bitset<2>(v) << endl;
  }
  for (int i = 0; i < n; ++i)
    output(ans[i]);
}
// ans[i] < 2^8
// g++-13 grader.cpp encoder.cpp decoder.cpp -o par && ./par < grader.in.1
# Verdict Execution time Memory Grader output
1 Correct 0 ms 648 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 1036 KB Output is correct
2 Correct 1 ms 1040 KB Output is correct
3 Correct 2 ms 1036 KB Output is correct
4 Correct 1 ms 1036 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 1036 KB Output is correct
2 Correct 1 ms 1028 KB Output is correct
3 Correct 2 ms 972 KB Output is correct
4 Correct 3 ms 1044 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 956 KB Output is correct
2 Correct 2 ms 1032 KB Output is correct
3 Incorrect 1 ms 1044 KB Error : Output is wrong
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 1036 KB Output is correct - P = 4.000000
2 Incorrect 2 ms 1056 KB Error : Output is wrong
3 Incorrect 2 ms 1052 KB Error : Output is wrong
4 Incorrect 2 ms 1076 KB Error : Output is wrong
5 Incorrect 3 ms 1076 KB Error : Output is wrong
6 Incorrect 3 ms 1072 KB Error : Output is wrong
7 Incorrect 3 ms 1080 KB Error : Output is wrong