답안 #396171

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
396171 2021-04-29T14:06:01 Z snasibov05 기지국 (IOI20_stations) C++14
8 / 100
987 ms 604 KB
#include "stations.h"
#include <vector>

#define pb push_back

using namespace std;



vector<int> label(int n, int k, vector<int> u, vector<int> v) {
	vector<int> labels(n);

    for (int i = 0; i < n; ++i) {
        labels[i] = i;
    }

	return labels;
}

int find_next_station(int s, int t, vector<int> c) {

    int level_s = 0, level_t = 0;

    int x = s;
    while (x > 0) level_s++, x/=2;

    if (s == (1 << level_s) - 1) level_s++;

    x = t;
    while (x > 0) level_t++, x/=2;

    if (t == (1 << level_t) - 1) level_t++;

    int a = s;
    int b = t;

    while (level_t > level_s) b = (b-1) / 2, level_t--;

    if (a == b){
        while ((t-1)/2 != s) t = (t-1) / 2;
        return t;
    }
    else return (s-1)/2;

}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 765 ms 476 KB Wrong query response.
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 532 ms 604 KB Output is correct
2 Correct 526 ms 400 KB Output is correct
3 Correct 944 ms 400 KB Output is correct
4 Correct 771 ms 556 KB Output is correct
5 Correct 660 ms 484 KB Output is correct
6 Correct 537 ms 400 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 663 ms 400 KB Wrong query response.
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 987 ms 472 KB Output is correct
2 Incorrect 735 ms 400 KB Wrong query response.
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 484 ms 400 KB Wrong query response.
2 Halted 0 ms 0 KB -