Submission #565105

# Submission time Handle Problem Language Result Execution time Memory
565105 2022-05-20T09:40:39 Z Rifal Saveit (IOI10_saveit) C++14
0 / 100
246 ms 12748 KB
#include <bits/stdc++.h>
#include <fstream>
#include "grader.h"
#include "encoder.h"
#define endl '\n'
#define mod 32768
#define INF 100000000000000
//#define ll long long
//#define cin fin
//#define cout fout
using namespace std;
//ofstream fout("convention.out");
//ifstream fin("convention.in");
const int M = 1005;
vector<int> v[M];
long long dist[M];
void bfs(int s)
{
    dist[s] = 0;
    queue<int> q;
    q.push(s);
    while(!q.empty())
    {
        int x = q.front();
        q.pop();
        for(auto i : v[x])
        {
            if(dist[i] == INF)
            {
                q.push(i);
                dist[i] = dist[x]+1;
            }
        }
    }
}
void encode(int n, int h, int p, int a[], int b[])
{
    for(int i = 0; i < p; i++)
    {
        v[a[i]].push_back(b[i]);
        v[b[i]].push_back(a[i]);
    }
    for(int i = 0; i < h; i++)
    {
        for(int j = 0; j < n; j++)
        {
            dist[j] = INF;
        }
        bfs(i);
       for(int j = 0; j < n; j++)
       {
           int y = dist[j];
           for(int q = 0; q < 11; q++)
           {
               if((y&(1<<q)) == 1)
               {
                   encode_bit(1);
               }
               else
               {
                   encode_bit(0);
               }
           }
       }
    }
 
}
#include "grader.h"
#include "decoder.h"
#include <bits/stdc++.h>
#include <fstream>
#define endl '\n'
#define mod 32768
#define INF 100000000000000
//#define ll long long
//#define cin fin
//#define cout fout
using namespace std;
//ofstream fout("convention.out");
//ifstream fin("convention.in");
void decode(int n, int h)
{
    long long pw2[11];
    pw2[0] = 1;
    for(int i = 1; i < 11; i++)
    {
        pw2[i] = pw2[i-1]*2;
    }
    for(int i = 0; i < h; i++)
    {
        for(int j = 0; j < n; j++)
        {
            long long cnt = 0;
            for(int q = 0; q < 11; q++)
            {
                if(decode_bit() == 1)
                {
                    cnt += pw2[q];
                }
            }
            hops(i,j,cnt);
        }
    }
}
# Verdict Execution time Memory Grader output
1 Incorrect 246 ms 12748 KB Output isn't correct
2 Incorrect 2 ms 4612 KB Output isn't correct
3 Incorrect 68 ms 7524 KB Output isn't correct
4 Incorrect 2 ms 4604 KB Output isn't correct
5 Incorrect 69 ms 7832 KB Output isn't correct
6 Incorrect 71 ms 8068 KB Output isn't correct
7 Incorrect 89 ms 8368 KB Output isn't correct
8 Incorrect 82 ms 7780 KB Output isn't correct
9 Incorrect 78 ms 7896 KB Output isn't correct
10 Incorrect 71 ms 7944 KB Output isn't correct
11 Incorrect 76 ms 8072 KB Output isn't correct
12 Incorrect 72 ms 7852 KB Output isn't correct
13 Incorrect 95 ms 8604 KB Output isn't correct
14 Incorrect 88 ms 7896 KB Output isn't correct
15 Incorrect 80 ms 7940 KB Output isn't correct
16 Incorrect 92 ms 8368 KB Output isn't correct
17 Incorrect 90 ms 8320 KB Output isn't correct
18 Incorrect 93 ms 8660 KB Output isn't correct
19 Incorrect 99 ms 8176 KB Output isn't correct
20 Incorrect 125 ms 8960 KB Output isn't correct
21 Incorrect 108 ms 8940 KB Output isn't correct
22 Incorrect 107 ms 8568 KB Output isn't correct
23 Incorrect 112 ms 9296 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Incorrect 246 ms 12748 KB Output isn't correct
2 Incorrect 2 ms 4612 KB Output isn't correct
3 Incorrect 68 ms 7524 KB Output isn't correct
4 Incorrect 2 ms 4604 KB Output isn't correct
5 Incorrect 69 ms 7832 KB Output isn't correct
6 Incorrect 71 ms 8068 KB Output isn't correct
7 Incorrect 89 ms 8368 KB Output isn't correct
8 Incorrect 82 ms 7780 KB Output isn't correct
9 Incorrect 78 ms 7896 KB Output isn't correct
10 Incorrect 71 ms 7944 KB Output isn't correct
11 Incorrect 76 ms 8072 KB Output isn't correct
12 Incorrect 72 ms 7852 KB Output isn't correct
13 Incorrect 95 ms 8604 KB Output isn't correct
14 Incorrect 88 ms 7896 KB Output isn't correct
15 Incorrect 80 ms 7940 KB Output isn't correct
16 Incorrect 92 ms 8368 KB Output isn't correct
17 Incorrect 90 ms 8320 KB Output isn't correct
18 Incorrect 93 ms 8660 KB Output isn't correct
19 Incorrect 99 ms 8176 KB Output isn't correct
20 Incorrect 125 ms 8960 KB Output isn't correct
21 Incorrect 108 ms 8940 KB Output isn't correct
22 Incorrect 107 ms 8568 KB Output isn't correct
23 Incorrect 112 ms 9296 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Incorrect 246 ms 12748 KB Output isn't correct
2 Incorrect 2 ms 4612 KB Output isn't correct
3 Incorrect 68 ms 7524 KB Output isn't correct
4 Incorrect 2 ms 4604 KB Output isn't correct
5 Incorrect 69 ms 7832 KB Output isn't correct
6 Incorrect 71 ms 8068 KB Output isn't correct
7 Incorrect 89 ms 8368 KB Output isn't correct
8 Incorrect 82 ms 7780 KB Output isn't correct
9 Incorrect 78 ms 7896 KB Output isn't correct
10 Incorrect 71 ms 7944 KB Output isn't correct
11 Incorrect 76 ms 8072 KB Output isn't correct
12 Incorrect 72 ms 7852 KB Output isn't correct
13 Incorrect 95 ms 8604 KB Output isn't correct
14 Incorrect 88 ms 7896 KB Output isn't correct
15 Incorrect 80 ms 7940 KB Output isn't correct
16 Incorrect 92 ms 8368 KB Output isn't correct
17 Incorrect 90 ms 8320 KB Output isn't correct
18 Incorrect 93 ms 8660 KB Output isn't correct
19 Incorrect 99 ms 8176 KB Output isn't correct
20 Incorrect 125 ms 8960 KB Output isn't correct
21 Incorrect 108 ms 8940 KB Output isn't correct
22 Incorrect 107 ms 8568 KB Output isn't correct
23 Incorrect 112 ms 9296 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Incorrect 246 ms 12748 KB Output isn't correct
2 Incorrect 2 ms 4612 KB Output isn't correct
3 Incorrect 68 ms 7524 KB Output isn't correct
4 Incorrect 2 ms 4604 KB Output isn't correct
5 Incorrect 69 ms 7832 KB Output isn't correct
6 Incorrect 71 ms 8068 KB Output isn't correct
7 Incorrect 89 ms 8368 KB Output isn't correct
8 Incorrect 82 ms 7780 KB Output isn't correct
9 Incorrect 78 ms 7896 KB Output isn't correct
10 Incorrect 71 ms 7944 KB Output isn't correct
11 Incorrect 76 ms 8072 KB Output isn't correct
12 Incorrect 72 ms 7852 KB Output isn't correct
13 Incorrect 95 ms 8604 KB Output isn't correct
14 Incorrect 88 ms 7896 KB Output isn't correct
15 Incorrect 80 ms 7940 KB Output isn't correct
16 Incorrect 92 ms 8368 KB Output isn't correct
17 Incorrect 90 ms 8320 KB Output isn't correct
18 Incorrect 93 ms 8660 KB Output isn't correct
19 Incorrect 99 ms 8176 KB Output isn't correct
20 Incorrect 125 ms 8960 KB Output isn't correct
21 Incorrect 108 ms 8940 KB Output isn't correct
22 Incorrect 107 ms 8568 KB Output isn't correct
23 Incorrect 112 ms 9296 KB Output isn't correct