# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
403977 | rama_pang | Love Polygon (BOI18_polygon) | C++17 | 319 ms | 36376 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>
using namespace std;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
int N;
cin >> N;
vector<int> to(N);
const auto GetName = [&](string s) {
static map<string, int> mp;
if (mp.count(s)) return mp[s];
return mp[s] = mp.size();
};
for (int i = 0; i < N; i++) {
string s, t;
cin >> s >> t;
int u = GetName(s);
int v = GetName(t);
to[u] = v;
}
if (N & 1) {
cout << -1 << '\n';
return 0;
}
# | 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... |