답안 #565005

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
565005 2022-05-20T07:34:07 Z RealSnake 저장 (Saveit) (IOI10_saveit) C++14
0 / 100
1507 ms 48728 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(x <= i && 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 1507 ms 48728 KB Output isn't correct
2 Correct 2 ms 4604 KB Output is correct - 150 call(s) of encode_bit()
3 Incorrect 739 ms 36524 KB Output isn't correct
4 Correct 2 ms 4612 KB Output is correct - 150 call(s) of encode_bit()
5 Incorrect 790 ms 36828 KB Output isn't correct
6 Incorrect 950 ms 44176 KB Output isn't correct
7 Incorrect 1049 ms 44612 KB Output isn't correct
8 Incorrect 819 ms 41056 KB Output isn't correct
9 Incorrect 858 ms 44060 KB Output isn't correct
10 Incorrect 898 ms 44004 KB Output isn't correct
11 Incorrect 975 ms 44116 KB Output isn't correct
12 Incorrect 936 ms 43860 KB Output isn't correct
13 Incorrect 1142 ms 44812 KB Output isn't correct
14 Incorrect 967 ms 44008 KB Output isn't correct
15 Incorrect 987 ms 44020 KB Output isn't correct
16 Incorrect 1098 ms 44520 KB Output isn't correct
17 Incorrect 1101 ms 44492 KB Output isn't correct
18 Incorrect 1061 ms 44764 KB Output isn't correct
19 Incorrect 998 ms 44420 KB Output isn't correct
20 Incorrect 1113 ms 45036 KB Output isn't correct
21 Incorrect 1143 ms 45228 KB Output isn't correct
22 Incorrect 1008 ms 44736 KB Output isn't correct
23 Incorrect 1083 ms 45412 KB Output isn't correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1507 ms 48728 KB Output isn't correct
2 Correct 2 ms 4604 KB Output is correct - 150 call(s) of encode_bit()
3 Incorrect 739 ms 36524 KB Output isn't correct
4 Correct 2 ms 4612 KB Output is correct - 150 call(s) of encode_bit()
5 Incorrect 790 ms 36828 KB Output isn't correct
6 Incorrect 950 ms 44176 KB Output isn't correct
7 Incorrect 1049 ms 44612 KB Output isn't correct
8 Incorrect 819 ms 41056 KB Output isn't correct
9 Incorrect 858 ms 44060 KB Output isn't correct
10 Incorrect 898 ms 44004 KB Output isn't correct
11 Incorrect 975 ms 44116 KB Output isn't correct
12 Incorrect 936 ms 43860 KB Output isn't correct
13 Incorrect 1142 ms 44812 KB Output isn't correct
14 Incorrect 967 ms 44008 KB Output isn't correct
15 Incorrect 987 ms 44020 KB Output isn't correct
16 Incorrect 1098 ms 44520 KB Output isn't correct
17 Incorrect 1101 ms 44492 KB Output isn't correct
18 Incorrect 1061 ms 44764 KB Output isn't correct
19 Incorrect 998 ms 44420 KB Output isn't correct
20 Incorrect 1113 ms 45036 KB Output isn't correct
21 Incorrect 1143 ms 45228 KB Output isn't correct
22 Incorrect 1008 ms 44736 KB Output isn't correct
23 Incorrect 1083 ms 45412 KB Output isn't correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1507 ms 48728 KB Output isn't correct
2 Correct 2 ms 4604 KB Output is correct - 150 call(s) of encode_bit()
3 Incorrect 739 ms 36524 KB Output isn't correct
4 Correct 2 ms 4612 KB Output is correct - 150 call(s) of encode_bit()
5 Incorrect 790 ms 36828 KB Output isn't correct
6 Incorrect 950 ms 44176 KB Output isn't correct
7 Incorrect 1049 ms 44612 KB Output isn't correct
8 Incorrect 819 ms 41056 KB Output isn't correct
9 Incorrect 858 ms 44060 KB Output isn't correct
10 Incorrect 898 ms 44004 KB Output isn't correct
11 Incorrect 975 ms 44116 KB Output isn't correct
12 Incorrect 936 ms 43860 KB Output isn't correct
13 Incorrect 1142 ms 44812 KB Output isn't correct
14 Incorrect 967 ms 44008 KB Output isn't correct
15 Incorrect 987 ms 44020 KB Output isn't correct
16 Incorrect 1098 ms 44520 KB Output isn't correct
17 Incorrect 1101 ms 44492 KB Output isn't correct
18 Incorrect 1061 ms 44764 KB Output isn't correct
19 Incorrect 998 ms 44420 KB Output isn't correct
20 Incorrect 1113 ms 45036 KB Output isn't correct
21 Incorrect 1143 ms 45228 KB Output isn't correct
22 Incorrect 1008 ms 44736 KB Output isn't correct
23 Incorrect 1083 ms 45412 KB Output isn't correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1507 ms 48728 KB Output isn't correct
2 Correct 2 ms 4604 KB Output is correct - 150 call(s) of encode_bit()
3 Incorrect 739 ms 36524 KB Output isn't correct
4 Correct 2 ms 4612 KB Output is correct - 150 call(s) of encode_bit()
5 Incorrect 790 ms 36828 KB Output isn't correct
6 Incorrect 950 ms 44176 KB Output isn't correct
7 Incorrect 1049 ms 44612 KB Output isn't correct
8 Incorrect 819 ms 41056 KB Output isn't correct
9 Incorrect 858 ms 44060 KB Output isn't correct
10 Incorrect 898 ms 44004 KB Output isn't correct
11 Incorrect 975 ms 44116 KB Output isn't correct
12 Incorrect 936 ms 43860 KB Output isn't correct
13 Incorrect 1142 ms 44812 KB Output isn't correct
14 Incorrect 967 ms 44008 KB Output isn't correct
15 Incorrect 987 ms 44020 KB Output isn't correct
16 Incorrect 1098 ms 44520 KB Output isn't correct
17 Incorrect 1101 ms 44492 KB Output isn't correct
18 Incorrect 1061 ms 44764 KB Output isn't correct
19 Incorrect 998 ms 44420 KB Output isn't correct
20 Incorrect 1113 ms 45036 KB Output isn't correct
21 Incorrect 1143 ms 45228 KB Output isn't correct
22 Incorrect 1008 ms 44736 KB Output isn't correct
23 Incorrect 1083 ms 45412 KB Output isn't correct