Submission #385977

# Submission time Handle Problem Language Result Execution time Memory
385977 2021-04-05T10:13:45 Z PedroBigMan Stations (IOI20_stations) C++14
0 / 100
1035 ms 1052 KB
#include "stations.h"
/*
Author of all code: Pedro BIGMAN Dias
Last edit: 15/02/2021
*/
#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <string>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <queue>
#include <deque>
#include <list>
#include <iomanip>
#include <stdlib.h>
#include <time.h>
#include <cstring>
using namespace std;
typedef int ll;
typedef unsigned long long int ull;
typedef long double ld;
#define REP(i,a,b) for(ll i=(ll) a; i<(ll) b; i++)
#define pb push_back
#define mp make_pair
#define pl pair<ll,ll>
#define ff first
#define ss second
#define whole(x) x.begin(),x.end()
#define DEBUG(i) cout<<"Pedro Is The Master "<<i<<endl
#define INF 500000000LL
#define EPS 0.00000001
#define pi 3.14159
ll mod=1000000007LL;
 
template<class A=ll> 
void Out(vector<A> a) {REP(i,0,a.size()) {cout<<a[i]<<" ";} cout<<endl;}
 
template<class A=ll>
void In(vector<A> &a, ll N) {A cur; REP(i,0,N) {cin>>cur; a.pb(cur);}}
 
vector<ll> label(ll N, ll k, vector<ll> u, vector<ll> v) 
{
	vector<ll> label; REP(i,0,N) {label.pb(i);} return label;
}
 
ll find_next_station(ll s, ll t, vector<ll> c) 
{
	ll cur = t; ll prev; while(cur>s) {prev=cur; cur=cur/2;}
	if(cur==s) {return prev;} else {return (s/2);}
}

Compilation message

stations.cpp: In function 'll find_next_station(ll, ll, std::vector<int>)':
stations.cpp:52:17: warning: 'prev' may be used uninitialized in this function [-Wmaybe-uninitialized]
   52 |  ll cur = t; ll prev; while(cur>s) {prev=cur; cur=cur/2;}
      |                 ^~~~
# Verdict Execution time Memory Grader output
1 Incorrect 579 ms 748 KB Wrong query response.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 465 ms 1052 KB Wrong query response.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 535 ms 756 KB Wrong query response.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1035 ms 884 KB Output is correct
2 Incorrect 703 ms 996 KB Wrong query response.
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 684 ms 844 KB Wrong query response.
2 Halted 0 ms 0 KB -