Submission #1054706

# Submission time Handle Problem Language Result Execution time Memory
1054706 2024-08-12T11:39:30 Z LittleOrange Stations (IOI20_stations) C++17
0 / 100
454 ms 684 KB
#include "stations.h"
#include <vector>
#include<bits/stdc++.h>
using namespace std;
using ll = int;

std::vector<int> label(int n, int k, std::vector<int> u, std::vector<int> v) {
	std::vector<int> labels(n);
	for (int i = 0; i < n; i++) {
		labels[i] = i;
	}
	return labels;
}

int find_next_station(int s, int t, std::vector<int> c) {
	s++;t++;
	ll lgs = __lg(s), lgt = __lg(t);
	if (lgs<lgt){
		ll x = s<<(lgt-lgs);
		if (t==x|((1<<(lgt-lgs))-1)){
			return (t>>(lgt-lgs-1))-1;
		}
	}
	return (s>>1)-1;
}

Compilation message

stations.cpp: In function 'int find_next_station(int, int, std::vector<int>)':
stations.cpp:20:8: warning: suggest parentheses around comparison in operand of '|' [-Wparentheses]
   20 |   if (t==x|((1<<(lgt-lgs))-1)){
      |       ~^~~
# Verdict Execution time Memory Grader output
1 Incorrect 279 ms 684 KB Wrong query response.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 231 ms 684 KB Wrong query response.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 286 ms 684 KB Wrong query response.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 454 ms 684 KB Output is correct
2 Incorrect 377 ms 684 KB Wrong query response.
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 298 ms 684 KB Wrong query response.
2 Halted 0 ms 0 KB -