# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
384272 | AdiZer0 | Zamjena (COCI18_zamjena) | C++17 | 142 ms | 17536 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
#define pb push_back
#define whole(x) x.begin(), x.end()
#define sz(x) (int)x.size()
using namespace std;
typedef long long ll;
typedef long double ld;
const int N = (int)1e5 + 7;
const int INF = (int)1e9 + 7;
const ll linf = (ll)1e18 + 1;
string a[N], b[N];
bool used[N];
string val[N], ans = "-1";
vector<int> g[N];
map<string, int> was;
bool dfs(int v) {
used[v] = 1;
if (ans == "-1" && ('0' <= val[v][0] && val[v][0] <= '9')) ans = val[v];
if (ans != "-1" && ('0' <= val[v][0] && val[v][0] <= '9') && ans != val[v]) return false;
for (int to : g[v]) {
if (!used[to]) {
if (!dfs(to)) return false;
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |