Submission #287797

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
2877972020-09-01 01:11:03thomas_liOne-Way Streets (CEOI17_oneway)C++17
100 / 100
84 ms19060 KiB
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/priority_queue.hpp>
using namespace std;
using ll = long long;
using ld = long double;
using vi = vector<int>;
using pi = pair<int, int>;
using pll = pair<ll, ll>;
constexpr int INF = 0x3f3f3f3f; constexpr ll LLINF = 0x3f3f3f3f3f3f3f3f;
#define db(x) { cerr << #x << " = " << x << endl; }
template <typename T> void _dbarr(T* a, size_t sz){ for(int i = 0; i < sz; i++) cerr << a[i] << " \n"[i == sz-1]; }
template <typename T> void _dbarr(vector<T> a, size_t sz){ for(int i = 0; i < sz; i++) cerr << a[i] << " \n"[i == sz-1]; }
#define dbarr(x, n) {cerr << #x << ": "; _dbarr((x),(n));}
#define all(x) begin(x), end(x)
#define pb push_back
#define eb emplace_back
#define mpr make_pair
#define fs first
#define sn second
template <class T> struct is_iterator {
template <class U, typename enable_if<!is_convertible<U, const char*>::value, int>::type = 0>
constexpr static auto has_indirection(int) -> decltype(*declval<U>(), bool()) { return true; }
template <class> constexpr static bool has_indirection(long) { return false; }
constexpr static bool value = has_indirection<T>(0);
};
using uint = unsigned int;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

oneway.cpp: In instantiation of 'int InputDevice::readUnsignedIntGeneral(I&, char) [with I = unsigned int]':
oneway.cpp:82:81:   required from 'int InputDevice::readUnsignedInt(I&, char) [with I = unsigned int]'
oneway.cpp:95:41:   required from 'bool InputDevice::readSignedInt(I&, char) [with I = int]'
oneway.cpp:177:72:   required from 'typename std::enable_if<(std::is_integral<_Tp>::value && std::is_signed<_Tp>::value), bool>::type InputDevice::read(I&) [with I = int; typename std::enable_if<(std::is_integral<_Tp>::value && std::is_signed<_Tp>::value), bool>::type = bool]'
oneway.cpp:490:96:   required from 'bool read(Ts&& ...) [with Ts = {int&}]'
oneway.cpp:542:11:   required from here
oneway.cpp:74:13: warning: comparison of integer expressions of different signedness: 'char' and 'uint' {aka 'unsigned int'} [-Wsign-compare]
   74 |       if (c >= base) break;
      |           ~~^~~~~~~
oneway.cpp: In function 'int main()':
oneway.cpp:546:20: warning: 'u' may be used uninitialized in this function [-Wmaybe-uninitialized]
  546 |         diff[comp[u]]++; diff[comp[v]]--;
      |              ~~~~~~^
oneway.cpp:546:37: warning: 'v' may be used uninitialized in this function [-Wmaybe-uninitialized]
  546 |         diff[comp[u]]++; diff[comp[v]]--;
      |                               ~~~~~~^
oneway.cpp:537:13: warning: 'u' may be used uninitialized in this function [-Wmaybe-uninitialized]
  537 |         int u,v;
      |             ^
oneway.cpp:537:15: warning: 'v' may be used uninitialized in this function [-Wmaybe-uninitialized]
  537 |         int u,v;
      |               ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...