Submission #792127

# Submission time Handle Problem Language Result Execution time Memory
792127 2023-07-24T15:36:09 Z irmuun Saveit (IOI10_saveit) C++17
0 / 100
169 ms 12688 KB
#include<bits/stdc++.h>
#include "grader.h"
#include "encoder.h"
 
using namespace std;
 
#define ll long long
#define pb push_back
#define ff first
#define ss second
#define all(s) s.begin(),s.end()
 
void encode(int N,int H,int P,int *A,int *B){
    vector<int>adj[N];
    for(int i=0;i<P;i++){
        adj[A[i]].pb(B[i]);
        adj[B[i]].pb(A[i]);
    }
    pair<int,int>d[N];
    for(int i=0;i<H;i++){
        for(int j=0;j<N;j++){
            d[i]={-1,j};
        }
        queue<int>q;
        d[i].ff=0;
        q.push(i);
        while(!q.empty()){
            int x=q.front();
            q.pop();
            for(auto y:adj[x]){
                if(d[y].ff==-1){
                    d[y].ff=d[x].ff+1;
                    q.push(y);
                }
            }
        }
        sort(d,d+N);
        for(int j=1;j<N;j++){
            if(d[j].ff==d[j-1].ff){
                encode_bit(0);
            }
            else{
                encode_bit(1);
            }
            for(int k=0;k<10;k++){
                encode_bit(d[j].ss%2);
                d[j].ss/=2;
            }
        }
    }
}
#include<bits/stdc++.h>
#include "grader.h"
#include "decoder.h"
 
using namespace std;
 
#define ll long long
#define pb push_back
#define ff first
#define ss second
#define all(s) s.begin(),s.end()
 
void decode(int N,int H){
    for(int i=0;i<H;i++){
        hops(i,i,0);
        int dist=0;
        for(int j=1;j<N;j++){
            int city=0;
            dist+=decode_bit();
            for(int k=0;k<10;k++){
                city+=decode_bit()*(1<<k);
            }
            hops(i,city,dist);
        }
    }
}
# Verdict Execution time Memory Grader output
1 Incorrect 169 ms 12688 KB duplicate hops call
2 Incorrect 2 ms 4604 KB duplicate hops call
3 Incorrect 50 ms 7516 KB duplicate hops call
4 Incorrect 1 ms 4604 KB duplicate hops call
5 Incorrect 51 ms 7724 KB duplicate hops call
6 Incorrect 73 ms 8088 KB duplicate hops call
7 Incorrect 74 ms 8276 KB duplicate hops call
8 Incorrect 71 ms 7700 KB duplicate hops call
9 Incorrect 55 ms 7932 KB duplicate hops call
10 Incorrect 57 ms 7856 KB duplicate hops call
11 Incorrect 56 ms 7924 KB duplicate hops call
12 Incorrect 55 ms 7660 KB duplicate hops call
13 Incorrect 82 ms 8428 KB duplicate hops call
14 Incorrect 67 ms 7828 KB duplicate hops call
15 Incorrect 56 ms 7948 KB duplicate hops call
16 Incorrect 66 ms 8296 KB duplicate hops call
17 Incorrect 72 ms 8368 KB duplicate hops call
18 Incorrect 83 ms 8628 KB duplicate hops call
19 Incorrect 66 ms 8144 KB duplicate hops call
20 Incorrect 86 ms 8768 KB duplicate hops call
21 Incorrect 80 ms 8928 KB duplicate hops call
22 Incorrect 87 ms 8408 KB duplicate hops call
23 Incorrect 96 ms 9208 KB duplicate hops call
# Verdict Execution time Memory Grader output
1 Incorrect 169 ms 12688 KB duplicate hops call
2 Incorrect 2 ms 4604 KB duplicate hops call
3 Incorrect 50 ms 7516 KB duplicate hops call
4 Incorrect 1 ms 4604 KB duplicate hops call
5 Incorrect 51 ms 7724 KB duplicate hops call
6 Incorrect 73 ms 8088 KB duplicate hops call
7 Incorrect 74 ms 8276 KB duplicate hops call
8 Incorrect 71 ms 7700 KB duplicate hops call
9 Incorrect 55 ms 7932 KB duplicate hops call
10 Incorrect 57 ms 7856 KB duplicate hops call
11 Incorrect 56 ms 7924 KB duplicate hops call
12 Incorrect 55 ms 7660 KB duplicate hops call
13 Incorrect 82 ms 8428 KB duplicate hops call
14 Incorrect 67 ms 7828 KB duplicate hops call
15 Incorrect 56 ms 7948 KB duplicate hops call
16 Incorrect 66 ms 8296 KB duplicate hops call
17 Incorrect 72 ms 8368 KB duplicate hops call
18 Incorrect 83 ms 8628 KB duplicate hops call
19 Incorrect 66 ms 8144 KB duplicate hops call
20 Incorrect 86 ms 8768 KB duplicate hops call
21 Incorrect 80 ms 8928 KB duplicate hops call
22 Incorrect 87 ms 8408 KB duplicate hops call
23 Incorrect 96 ms 9208 KB duplicate hops call
# Verdict Execution time Memory Grader output
1 Incorrect 169 ms 12688 KB duplicate hops call
2 Incorrect 2 ms 4604 KB duplicate hops call
3 Incorrect 50 ms 7516 KB duplicate hops call
4 Incorrect 1 ms 4604 KB duplicate hops call
5 Incorrect 51 ms 7724 KB duplicate hops call
6 Incorrect 73 ms 8088 KB duplicate hops call
7 Incorrect 74 ms 8276 KB duplicate hops call
8 Incorrect 71 ms 7700 KB duplicate hops call
9 Incorrect 55 ms 7932 KB duplicate hops call
10 Incorrect 57 ms 7856 KB duplicate hops call
11 Incorrect 56 ms 7924 KB duplicate hops call
12 Incorrect 55 ms 7660 KB duplicate hops call
13 Incorrect 82 ms 8428 KB duplicate hops call
14 Incorrect 67 ms 7828 KB duplicate hops call
15 Incorrect 56 ms 7948 KB duplicate hops call
16 Incorrect 66 ms 8296 KB duplicate hops call
17 Incorrect 72 ms 8368 KB duplicate hops call
18 Incorrect 83 ms 8628 KB duplicate hops call
19 Incorrect 66 ms 8144 KB duplicate hops call
20 Incorrect 86 ms 8768 KB duplicate hops call
21 Incorrect 80 ms 8928 KB duplicate hops call
22 Incorrect 87 ms 8408 KB duplicate hops call
23 Incorrect 96 ms 9208 KB duplicate hops call
# Verdict Execution time Memory Grader output
1 Incorrect 169 ms 12688 KB duplicate hops call
2 Incorrect 2 ms 4604 KB duplicate hops call
3 Incorrect 50 ms 7516 KB duplicate hops call
4 Incorrect 1 ms 4604 KB duplicate hops call
5 Incorrect 51 ms 7724 KB duplicate hops call
6 Incorrect 73 ms 8088 KB duplicate hops call
7 Incorrect 74 ms 8276 KB duplicate hops call
8 Incorrect 71 ms 7700 KB duplicate hops call
9 Incorrect 55 ms 7932 KB duplicate hops call
10 Incorrect 57 ms 7856 KB duplicate hops call
11 Incorrect 56 ms 7924 KB duplicate hops call
12 Incorrect 55 ms 7660 KB duplicate hops call
13 Incorrect 82 ms 8428 KB duplicate hops call
14 Incorrect 67 ms 7828 KB duplicate hops call
15 Incorrect 56 ms 7948 KB duplicate hops call
16 Incorrect 66 ms 8296 KB duplicate hops call
17 Incorrect 72 ms 8368 KB duplicate hops call
18 Incorrect 83 ms 8628 KB duplicate hops call
19 Incorrect 66 ms 8144 KB duplicate hops call
20 Incorrect 86 ms 8768 KB duplicate hops call
21 Incorrect 80 ms 8928 KB duplicate hops call
22 Incorrect 87 ms 8408 KB duplicate hops call
23 Incorrect 96 ms 9208 KB duplicate hops call