Submission #60396

# Submission time Handle Problem Language Result Execution time Memory
60396 2018-07-24T05:16:36 Z theknife2001 Parrots (IOI11_parrots) C++17
81 / 100
17 ms 2504 KB
#include "encoder.h"
#include "encoderlib.h"
#include <bits/stdc++.h>

using namespace std;


void encode(int N, int M[])
{
    for(int i=0;i<N;i++)
    {
        for(int j=0;j<8;j++)
        {
            if(M[i]&(1<<j))
            {
                if(i>24)
                {
                  	send(j+(i-25)*10);
                    send(j+(i-25)*10);
                }
                else
                {
                    send(j+i*10);
                }
            }
        }
    }
}
#include "decoder.h"
#include "decoderlib.h"
#include <algorithm>
#include <iostream>
#include <map>

using namespace std;

map < int , int > mp;

void decode(int N, int L, int X[])
{
    int a[260];
    for(int i=0;i<N;i++)
        a[i]=0;
    int x;
    for(int i=0;i<L;i++)
        mp[X[i]]++;
    int f,s;
    for(auto m:mp)
    {
        f=m.first;
        s=m.second;
        if(f!=0)
        {
            x=f%10;
            f/=10;
        }
        else
            x=0;
        if(s>1)
        {
           a[f+25]+=(1<<x);
           s-=2;
        }
        if(s==1)
        {
           a[f]+=(1<<x);
        }
    }
    mp.clear();
    for(int i=0;i<N;i++)
        output(a[i]);
}
# Verdict Execution time Memory Grader output
1 Correct 5 ms 752 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 6 ms 1736 KB Output is correct
2 Correct 7 ms 1920 KB Output is correct
3 Correct 6 ms 2376 KB Output is correct
4 Correct 8 ms 2408 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 4 ms 2408 KB Output is correct
2 Correct 7 ms 2408 KB Output is correct
3 Correct 6 ms 2408 KB Output is correct
4 Correct 9 ms 2408 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 6 ms 2408 KB Output is correct
2 Correct 8 ms 2408 KB Output is correct
3 Correct 8 ms 2408 KB Output is correct
4 Correct 8 ms 2408 KB Output is correct
5 Correct 12 ms 2408 KB Output is correct
6 Correct 12 ms 2408 KB Output is correct
# Verdict Execution time Memory Grader output
1 Partially correct 8 ms 2408 KB Output is partially correct - P = 8.000000
2 Partially correct 9 ms 2408 KB Output is partially correct - P = 9.750000
3 Partially correct 13 ms 2408 KB Output is partially correct - P = 9.939394
4 Partially correct 17 ms 2504 KB Output is partially correct - P = 12.000000
5 Incorrect 6 ms 2504 KB Error : Bad encoded integer
6 Incorrect 6 ms 2504 KB Error : Bad encoded integer
7 Incorrect 5 ms 2504 KB Error : Bad encoded integer