Submission #564986

# Submission time Handle Problem Language Result Execution time Memory
564986 2022-05-20T06:41:38 Z shrimb Saveit (IOI10_saveit) C++17
50 / 100
246 ms 12496 KB
#include "grader.h"
#include "encoder.h"
#include"bits/stdc++.h"
using namespace std;


void encode(int n, int h, int p, int *v1, int *v2){
  vector<int> adj[n + 1];
  for (int i = 0 ; i < p ; i++) {
      adj[v1[i]].push_back(v2[i]);
      adj[v2[i]].push_back(v1[i]);
  }
  for (int i = 0 ; i < h ; i++) {
      int dist[n];
      for (int j = 0 ; j < n ; j++) dist[j] = INT_MAX;
      dist[i] = 0;
      queue<int> q;
      q.push(i);
      while (q.size()) {
          auto cur = q.front();
          q.pop();
          for (int j : adj[cur]) {
              if (dist[j] > dist[cur] + 1) {
                  dist[j] = dist[cur] + 1;
                  q.push(j);
              }
          }
      }
      for (int j = 0 ; j < n ; j++) {
          for (int k = 0 ; k < 10 ; k++) {
              encode_bit(bool(dist[j] & (1 << k)));
          }
      }
  }
  return;
}
#include "grader.h"
#include "decoder.h"
#include "bits/stdc++.h"
using namespace std;
void decode(int n, int h) {
    int dist[h][n];
    memset(dist, 0, sizeof dist);
    for (int i = 0 ; i < h ; i++) {
        for (int j = 0 ; j < n ; j++) {
            for (int k = 0 ; k < 10 ; k++) {
                dist[i][j] |= ((1 << k)*decode_bit());
            }
        }
    }
    for (int i = 0 ; i < h ; i++) {
        for (int j = 0 ; j < n  ; j++) {
            hops(i, j, dist[i][j]);
        }
    }
}
# Verdict Execution time Memory Grader output
1 Correct 246 ms 12496 KB Output is partially correct - 360000 call(s) of encode_bit()
2 Correct 2 ms 4604 KB Output is correct - 150 call(s) of encode_bit()
3 Correct 71 ms 7332 KB Output is partially correct - 324000 call(s) of encode_bit()
4 Correct 2 ms 4604 KB Output is correct - 250 call(s) of encode_bit()
5 Correct 68 ms 7636 KB Output is partially correct - 324000 call(s) of encode_bit()
6 Correct 70 ms 7884 KB Output is partially correct - 360000 call(s) of encode_bit()
7 Correct 79 ms 8308 KB Output is partially correct - 360000 call(s) of encode_bit()
8 Correct 63 ms 7596 KB Output is partially correct - 345960 call(s) of encode_bit()
9 Correct 73 ms 7704 KB Output is partially correct - 360000 call(s) of encode_bit()
10 Correct 67 ms 7864 KB Output is partially correct - 360000 call(s) of encode_bit()
11 Correct 71 ms 7852 KB Output is partially correct - 360000 call(s) of encode_bit()
12 Correct 72 ms 7660 KB Output is partially correct - 360000 call(s) of encode_bit()
13 Correct 89 ms 8384 KB Output is partially correct - 360000 call(s) of encode_bit()
14 Correct 65 ms 7708 KB Output is partially correct - 360000 call(s) of encode_bit()
15 Correct 69 ms 7760 KB Output is partially correct - 360000 call(s) of encode_bit()
16 Correct 83 ms 8248 KB Output is partially correct - 360000 call(s) of encode_bit()
17 Correct 108 ms 8176 KB Output is partially correct - 360000 call(s) of encode_bit()
18 Correct 96 ms 8476 KB Output is partially correct - 360000 call(s) of encode_bit()
19 Correct 87 ms 8028 KB Output is partially correct - 360000 call(s) of encode_bit()
20 Correct 107 ms 8796 KB Output is partially correct - 360000 call(s) of encode_bit()
21 Correct 106 ms 8872 KB Output is partially correct - 360000 call(s) of encode_bit()
22 Correct 99 ms 8364 KB Output is partially correct - 360000 call(s) of encode_bit()
23 Correct 106 ms 9128 KB Output is partially correct - 360000 call(s) of encode_bit()
# Verdict Execution time Memory Grader output
1 Correct 246 ms 12496 KB Output is partially correct - 360000 call(s) of encode_bit()
2 Correct 2 ms 4604 KB Output is correct - 150 call(s) of encode_bit()
3 Correct 71 ms 7332 KB Output is partially correct - 324000 call(s) of encode_bit()
4 Correct 2 ms 4604 KB Output is correct - 250 call(s) of encode_bit()
5 Correct 68 ms 7636 KB Output is partially correct - 324000 call(s) of encode_bit()
6 Correct 70 ms 7884 KB Output is partially correct - 360000 call(s) of encode_bit()
7 Correct 79 ms 8308 KB Output is partially correct - 360000 call(s) of encode_bit()
8 Correct 63 ms 7596 KB Output is partially correct - 345960 call(s) of encode_bit()
9 Correct 73 ms 7704 KB Output is partially correct - 360000 call(s) of encode_bit()
10 Correct 67 ms 7864 KB Output is partially correct - 360000 call(s) of encode_bit()
11 Correct 71 ms 7852 KB Output is partially correct - 360000 call(s) of encode_bit()
12 Correct 72 ms 7660 KB Output is partially correct - 360000 call(s) of encode_bit()
13 Correct 89 ms 8384 KB Output is partially correct - 360000 call(s) of encode_bit()
14 Correct 65 ms 7708 KB Output is partially correct - 360000 call(s) of encode_bit()
15 Correct 69 ms 7760 KB Output is partially correct - 360000 call(s) of encode_bit()
16 Correct 83 ms 8248 KB Output is partially correct - 360000 call(s) of encode_bit()
17 Correct 108 ms 8176 KB Output is partially correct - 360000 call(s) of encode_bit()
18 Correct 96 ms 8476 KB Output is partially correct - 360000 call(s) of encode_bit()
19 Correct 87 ms 8028 KB Output is partially correct - 360000 call(s) of encode_bit()
20 Correct 107 ms 8796 KB Output is partially correct - 360000 call(s) of encode_bit()
21 Correct 106 ms 8872 KB Output is partially correct - 360000 call(s) of encode_bit()
22 Correct 99 ms 8364 KB Output is partially correct - 360000 call(s) of encode_bit()
23 Correct 106 ms 9128 KB Output is partially correct - 360000 call(s) of encode_bit()
# Verdict Execution time Memory Grader output
1 Correct 246 ms 12496 KB Output is partially correct - 360000 call(s) of encode_bit()
2 Correct 2 ms 4604 KB Output is correct - 150 call(s) of encode_bit()
3 Correct 71 ms 7332 KB Output is partially correct - 324000 call(s) of encode_bit()
4 Correct 2 ms 4604 KB Output is correct - 250 call(s) of encode_bit()
5 Correct 68 ms 7636 KB Output is partially correct - 324000 call(s) of encode_bit()
6 Correct 70 ms 7884 KB Output is partially correct - 360000 call(s) of encode_bit()
7 Correct 79 ms 8308 KB Output is partially correct - 360000 call(s) of encode_bit()
8 Correct 63 ms 7596 KB Output is partially correct - 345960 call(s) of encode_bit()
9 Correct 73 ms 7704 KB Output is partially correct - 360000 call(s) of encode_bit()
10 Correct 67 ms 7864 KB Output is partially correct - 360000 call(s) of encode_bit()
11 Correct 71 ms 7852 KB Output is partially correct - 360000 call(s) of encode_bit()
12 Correct 72 ms 7660 KB Output is partially correct - 360000 call(s) of encode_bit()
13 Correct 89 ms 8384 KB Output is partially correct - 360000 call(s) of encode_bit()
14 Correct 65 ms 7708 KB Output is partially correct - 360000 call(s) of encode_bit()
15 Correct 69 ms 7760 KB Output is partially correct - 360000 call(s) of encode_bit()
16 Correct 83 ms 8248 KB Output is partially correct - 360000 call(s) of encode_bit()
17 Correct 108 ms 8176 KB Output is partially correct - 360000 call(s) of encode_bit()
18 Correct 96 ms 8476 KB Output is partially correct - 360000 call(s) of encode_bit()
19 Correct 87 ms 8028 KB Output is partially correct - 360000 call(s) of encode_bit()
20 Correct 107 ms 8796 KB Output is partially correct - 360000 call(s) of encode_bit()
21 Correct 106 ms 8872 KB Output is partially correct - 360000 call(s) of encode_bit()
22 Correct 99 ms 8364 KB Output is partially correct - 360000 call(s) of encode_bit()
23 Correct 106 ms 9128 KB Output is partially correct - 360000 call(s) of encode_bit()
# Verdict Execution time Memory Grader output
1 Correct 246 ms 12496 KB Output is partially correct - 360000 call(s) of encode_bit()
2 Correct 2 ms 4604 KB Output is correct - 150 call(s) of encode_bit()
3 Correct 71 ms 7332 KB Output is partially correct - 324000 call(s) of encode_bit()
4 Correct 2 ms 4604 KB Output is correct - 250 call(s) of encode_bit()
5 Correct 68 ms 7636 KB Output is partially correct - 324000 call(s) of encode_bit()
6 Correct 70 ms 7884 KB Output is partially correct - 360000 call(s) of encode_bit()
7 Correct 79 ms 8308 KB Output is partially correct - 360000 call(s) of encode_bit()
8 Correct 63 ms 7596 KB Output is partially correct - 345960 call(s) of encode_bit()
9 Correct 73 ms 7704 KB Output is partially correct - 360000 call(s) of encode_bit()
10 Correct 67 ms 7864 KB Output is partially correct - 360000 call(s) of encode_bit()
11 Correct 71 ms 7852 KB Output is partially correct - 360000 call(s) of encode_bit()
12 Correct 72 ms 7660 KB Output is partially correct - 360000 call(s) of encode_bit()
13 Correct 89 ms 8384 KB Output is partially correct - 360000 call(s) of encode_bit()
14 Correct 65 ms 7708 KB Output is partially correct - 360000 call(s) of encode_bit()
15 Correct 69 ms 7760 KB Output is partially correct - 360000 call(s) of encode_bit()
16 Correct 83 ms 8248 KB Output is partially correct - 360000 call(s) of encode_bit()
17 Correct 108 ms 8176 KB Output is partially correct - 360000 call(s) of encode_bit()
18 Correct 96 ms 8476 KB Output is partially correct - 360000 call(s) of encode_bit()
19 Correct 87 ms 8028 KB Output is partially correct - 360000 call(s) of encode_bit()
20 Correct 107 ms 8796 KB Output is partially correct - 360000 call(s) of encode_bit()
21 Correct 106 ms 8872 KB Output is partially correct - 360000 call(s) of encode_bit()
22 Correct 99 ms 8364 KB Output is partially correct - 360000 call(s) of encode_bit()
23 Correct 106 ms 9128 KB Output is partially correct - 360000 call(s) of encode_bit()