# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
716515 | ajab_01 | Love Polygon (BOI18_polygon) | C++17 | 353 ms | 22384 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;
const int N = 1e5 + 5;
vector<int> g[N] , adj[N];
map<string , int> mp;
int ans , n , num , len;
bool deg[N] , vis[N] , ch = 1;
void dfs(int ver){
vis[ver] = 1;
len++;
for(int i : g[ver]){
if(vis[i]) continue;
dfs(i);
}
}
int main(){
ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
cin >> n;
for(int i = 0 ; i < n ; i++){
string a , b;
cin >> a >> b;
if(mp.find(a) == mp.end()) mp[a] = num++;
if(mp.find(b) == mp.end()) mp[b] = num++;
g[mp[a]].push_back(mp[b]);
adj[mp[b]].push_back(mp[a]);
deg[mp[b]] = 1;
}
# | 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... |