답안 #565100

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
565100 2022-05-20T09:33:08 Z Rifal 저장 (Saveit) (IOI10_saveit) C++14
0 / 100
239 ms 11872 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 < 8; 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[10];
    pw2[0] = 1;
    for(int i = 1; i < 10; 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 < 8; q++)
            {
                if(decode_bit() == 1)
                {
                    cnt += pw2[q];
                }
            }
            hops(i,j,cnt);
        }
    }
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 239 ms 11872 KB Output isn't correct
2 Incorrect 2 ms 4604 KB Output isn't correct
3 Incorrect 65 ms 6608 KB Output isn't correct
4 Incorrect 2 ms 4604 KB Output isn't correct
5 Incorrect 51 ms 6996 KB Output isn't correct
6 Incorrect 62 ms 7224 KB Output isn't correct
7 Incorrect 68 ms 7480 KB Output isn't correct
8 Incorrect 58 ms 6816 KB Output isn't correct
9 Incorrect 67 ms 6936 KB Output isn't correct
10 Incorrect 54 ms 7076 KB Output isn't correct
11 Incorrect 57 ms 7204 KB Output isn't correct
12 Incorrect 59 ms 7144 KB Output isn't correct
13 Incorrect 79 ms 7720 KB Output isn't correct
14 Incorrect 75 ms 7032 KB Output isn't correct
15 Incorrect 57 ms 7092 KB Output isn't correct
16 Incorrect 77 ms 7536 KB Output isn't correct
17 Incorrect 79 ms 7508 KB Output isn't correct
18 Incorrect 76 ms 7808 KB Output isn't correct
19 Incorrect 62 ms 7472 KB Output isn't correct
20 Incorrect 91 ms 8104 KB Output isn't correct
21 Incorrect 126 ms 8088 KB Output isn't correct
22 Incorrect 76 ms 7716 KB Output isn't correct
23 Incorrect 97 ms 8484 KB Output isn't correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 239 ms 11872 KB Output isn't correct
2 Incorrect 2 ms 4604 KB Output isn't correct
3 Incorrect 65 ms 6608 KB Output isn't correct
4 Incorrect 2 ms 4604 KB Output isn't correct
5 Incorrect 51 ms 6996 KB Output isn't correct
6 Incorrect 62 ms 7224 KB Output isn't correct
7 Incorrect 68 ms 7480 KB Output isn't correct
8 Incorrect 58 ms 6816 KB Output isn't correct
9 Incorrect 67 ms 6936 KB Output isn't correct
10 Incorrect 54 ms 7076 KB Output isn't correct
11 Incorrect 57 ms 7204 KB Output isn't correct
12 Incorrect 59 ms 7144 KB Output isn't correct
13 Incorrect 79 ms 7720 KB Output isn't correct
14 Incorrect 75 ms 7032 KB Output isn't correct
15 Incorrect 57 ms 7092 KB Output isn't correct
16 Incorrect 77 ms 7536 KB Output isn't correct
17 Incorrect 79 ms 7508 KB Output isn't correct
18 Incorrect 76 ms 7808 KB Output isn't correct
19 Incorrect 62 ms 7472 KB Output isn't correct
20 Incorrect 91 ms 8104 KB Output isn't correct
21 Incorrect 126 ms 8088 KB Output isn't correct
22 Incorrect 76 ms 7716 KB Output isn't correct
23 Incorrect 97 ms 8484 KB Output isn't correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 239 ms 11872 KB Output isn't correct
2 Incorrect 2 ms 4604 KB Output isn't correct
3 Incorrect 65 ms 6608 KB Output isn't correct
4 Incorrect 2 ms 4604 KB Output isn't correct
5 Incorrect 51 ms 6996 KB Output isn't correct
6 Incorrect 62 ms 7224 KB Output isn't correct
7 Incorrect 68 ms 7480 KB Output isn't correct
8 Incorrect 58 ms 6816 KB Output isn't correct
9 Incorrect 67 ms 6936 KB Output isn't correct
10 Incorrect 54 ms 7076 KB Output isn't correct
11 Incorrect 57 ms 7204 KB Output isn't correct
12 Incorrect 59 ms 7144 KB Output isn't correct
13 Incorrect 79 ms 7720 KB Output isn't correct
14 Incorrect 75 ms 7032 KB Output isn't correct
15 Incorrect 57 ms 7092 KB Output isn't correct
16 Incorrect 77 ms 7536 KB Output isn't correct
17 Incorrect 79 ms 7508 KB Output isn't correct
18 Incorrect 76 ms 7808 KB Output isn't correct
19 Incorrect 62 ms 7472 KB Output isn't correct
20 Incorrect 91 ms 8104 KB Output isn't correct
21 Incorrect 126 ms 8088 KB Output isn't correct
22 Incorrect 76 ms 7716 KB Output isn't correct
23 Incorrect 97 ms 8484 KB Output isn't correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 239 ms 11872 KB Output isn't correct
2 Incorrect 2 ms 4604 KB Output isn't correct
3 Incorrect 65 ms 6608 KB Output isn't correct
4 Incorrect 2 ms 4604 KB Output isn't correct
5 Incorrect 51 ms 6996 KB Output isn't correct
6 Incorrect 62 ms 7224 KB Output isn't correct
7 Incorrect 68 ms 7480 KB Output isn't correct
8 Incorrect 58 ms 6816 KB Output isn't correct
9 Incorrect 67 ms 6936 KB Output isn't correct
10 Incorrect 54 ms 7076 KB Output isn't correct
11 Incorrect 57 ms 7204 KB Output isn't correct
12 Incorrect 59 ms 7144 KB Output isn't correct
13 Incorrect 79 ms 7720 KB Output isn't correct
14 Incorrect 75 ms 7032 KB Output isn't correct
15 Incorrect 57 ms 7092 KB Output isn't correct
16 Incorrect 77 ms 7536 KB Output isn't correct
17 Incorrect 79 ms 7508 KB Output isn't correct
18 Incorrect 76 ms 7808 KB Output isn't correct
19 Incorrect 62 ms 7472 KB Output isn't correct
20 Incorrect 91 ms 8104 KB Output isn't correct
21 Incorrect 126 ms 8088 KB Output isn't correct
22 Incorrect 76 ms 7716 KB Output isn't correct
23 Incorrect 97 ms 8484 KB Output isn't correct