답안 #564997

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
564997 2022-05-20T07:26:18 Z RealSnake 저장 (Saveit) (IOI10_saveit) C++14
0 / 100
1721 ms 48640 KB
#include "bits/stdc++.h"
using namespace std;
#include "grader.h"
#include "encoder.h"

void encode(int n, int h, int p, int a[], int b[]) {
    vector<int> v[n];
    for(int i = 0; i < p; i++) {
        v[a[i]].push_back(b[i]);
        v[b[i]].push_back(a[i]);
    }
    int vis[n];
    for(int i = n - 1; i >= 0; i--) {
        for(int j = 0; j < n; j++)
            vis[j] = 1e9;
        set<pair<int, int>> s;
        s.insert({0, i});
        int y = i + 1;
        while(s.size()) {
            pair<int, int> p = *s.begin();
            s.erase(s.begin());
            int x = p.second;
            int d = p.first;
            if(d > vis[x])
                continue;
            if(vis[x] != d)
                y--;
            vis[x] = d;
            if(!y)
                break;
            for(int j : v[x]) {
                if(d + (j < h) < vis[j]) {
                    vis[j] = d + (j < h);
                    s.insert({d + (j < h), j});
                }
            }
        }
        for(int j = i; j >= 0; j--) {
            for(int bit = 0; bit < 10; bit++)
                encode_bit((vis[j] & (1 << bit)) > 0);
        }
    }
    return;
}
#include "bits/stdc++.h"
using namespace std;
#include "grader.h"
#include "encoder.h"

void decode(int n, int h) {
    for(int i = n - 1; i >= 0; i--) {
        for(int j = i; j >= 0; j--) {
            int d = 0;
            for(int bit = 0; bit < 10; bit++) {
                if(decode_bit())
                    d += (1 << bit);
            }
            if(j >= h)
                continue;
            hops(j, i, d);
            if(i < h && i != j)
                hops(i, j, d);
        }
    }
    return;
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1721 ms 48640 KB Output isn't correct
2 Correct 3 ms 4604 KB Output is correct - 150 call(s) of encode_bit()
3 Incorrect 943 ms 36532 KB Output isn't correct
4 Correct 3 ms 4604 KB Output is correct - 150 call(s) of encode_bit()
5 Incorrect 969 ms 36796 KB Output isn't correct
6 Incorrect 1061 ms 44224 KB Output isn't correct
7 Incorrect 1104 ms 44624 KB Output isn't correct
8 Incorrect 907 ms 41008 KB Output isn't correct
9 Incorrect 983 ms 44188 KB Output isn't correct
10 Incorrect 902 ms 44156 KB Output isn't correct
11 Incorrect 928 ms 44152 KB Output isn't correct
12 Incorrect 891 ms 43996 KB Output isn't correct
13 Incorrect 1081 ms 44648 KB Output isn't correct
14 Incorrect 984 ms 44044 KB Output isn't correct
15 Incorrect 911 ms 44280 KB Output isn't correct
16 Incorrect 1149 ms 44736 KB Output isn't correct
17 Incorrect 1057 ms 44444 KB Output isn't correct
18 Incorrect 1064 ms 44736 KB Output isn't correct
19 Incorrect 1014 ms 44324 KB Output isn't correct
20 Incorrect 1080 ms 45276 KB Output isn't correct
21 Incorrect 1263 ms 45192 KB Output isn't correct
22 Incorrect 1066 ms 44932 KB Output isn't correct
23 Incorrect 1230 ms 45512 KB Output isn't correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1721 ms 48640 KB Output isn't correct
2 Correct 3 ms 4604 KB Output is correct - 150 call(s) of encode_bit()
3 Incorrect 943 ms 36532 KB Output isn't correct
4 Correct 3 ms 4604 KB Output is correct - 150 call(s) of encode_bit()
5 Incorrect 969 ms 36796 KB Output isn't correct
6 Incorrect 1061 ms 44224 KB Output isn't correct
7 Incorrect 1104 ms 44624 KB Output isn't correct
8 Incorrect 907 ms 41008 KB Output isn't correct
9 Incorrect 983 ms 44188 KB Output isn't correct
10 Incorrect 902 ms 44156 KB Output isn't correct
11 Incorrect 928 ms 44152 KB Output isn't correct
12 Incorrect 891 ms 43996 KB Output isn't correct
13 Incorrect 1081 ms 44648 KB Output isn't correct
14 Incorrect 984 ms 44044 KB Output isn't correct
15 Incorrect 911 ms 44280 KB Output isn't correct
16 Incorrect 1149 ms 44736 KB Output isn't correct
17 Incorrect 1057 ms 44444 KB Output isn't correct
18 Incorrect 1064 ms 44736 KB Output isn't correct
19 Incorrect 1014 ms 44324 KB Output isn't correct
20 Incorrect 1080 ms 45276 KB Output isn't correct
21 Incorrect 1263 ms 45192 KB Output isn't correct
22 Incorrect 1066 ms 44932 KB Output isn't correct
23 Incorrect 1230 ms 45512 KB Output isn't correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1721 ms 48640 KB Output isn't correct
2 Correct 3 ms 4604 KB Output is correct - 150 call(s) of encode_bit()
3 Incorrect 943 ms 36532 KB Output isn't correct
4 Correct 3 ms 4604 KB Output is correct - 150 call(s) of encode_bit()
5 Incorrect 969 ms 36796 KB Output isn't correct
6 Incorrect 1061 ms 44224 KB Output isn't correct
7 Incorrect 1104 ms 44624 KB Output isn't correct
8 Incorrect 907 ms 41008 KB Output isn't correct
9 Incorrect 983 ms 44188 KB Output isn't correct
10 Incorrect 902 ms 44156 KB Output isn't correct
11 Incorrect 928 ms 44152 KB Output isn't correct
12 Incorrect 891 ms 43996 KB Output isn't correct
13 Incorrect 1081 ms 44648 KB Output isn't correct
14 Incorrect 984 ms 44044 KB Output isn't correct
15 Incorrect 911 ms 44280 KB Output isn't correct
16 Incorrect 1149 ms 44736 KB Output isn't correct
17 Incorrect 1057 ms 44444 KB Output isn't correct
18 Incorrect 1064 ms 44736 KB Output isn't correct
19 Incorrect 1014 ms 44324 KB Output isn't correct
20 Incorrect 1080 ms 45276 KB Output isn't correct
21 Incorrect 1263 ms 45192 KB Output isn't correct
22 Incorrect 1066 ms 44932 KB Output isn't correct
23 Incorrect 1230 ms 45512 KB Output isn't correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1721 ms 48640 KB Output isn't correct
2 Correct 3 ms 4604 KB Output is correct - 150 call(s) of encode_bit()
3 Incorrect 943 ms 36532 KB Output isn't correct
4 Correct 3 ms 4604 KB Output is correct - 150 call(s) of encode_bit()
5 Incorrect 969 ms 36796 KB Output isn't correct
6 Incorrect 1061 ms 44224 KB Output isn't correct
7 Incorrect 1104 ms 44624 KB Output isn't correct
8 Incorrect 907 ms 41008 KB Output isn't correct
9 Incorrect 983 ms 44188 KB Output isn't correct
10 Incorrect 902 ms 44156 KB Output isn't correct
11 Incorrect 928 ms 44152 KB Output isn't correct
12 Incorrect 891 ms 43996 KB Output isn't correct
13 Incorrect 1081 ms 44648 KB Output isn't correct
14 Incorrect 984 ms 44044 KB Output isn't correct
15 Incorrect 911 ms 44280 KB Output isn't correct
16 Incorrect 1149 ms 44736 KB Output isn't correct
17 Incorrect 1057 ms 44444 KB Output isn't correct
18 Incorrect 1064 ms 44736 KB Output isn't correct
19 Incorrect 1014 ms 44324 KB Output isn't correct
20 Incorrect 1080 ms 45276 KB Output isn't correct
21 Incorrect 1263 ms 45192 KB Output isn't correct
22 Incorrect 1066 ms 44932 KB Output isn't correct
23 Incorrect 1230 ms 45512 KB Output isn't correct