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(false);
cin.tie(0);
int n;
cin >> n;
vector<vector<int>> g(n);
map<string, int> vis;
int id = 1;
for (int i = 0; i < n; i++) {
string tmp;
getline(cin >> ws, tmp);
stringstream ss;
ss << tmp;
string s, K;
ss >> K;
if (vis[K]) {
cout << "greska" << '\n';
continue;
}
ss >> s;
vector<int> v;
int bl = 1;
while (1) {
ss >> s;
if (s == ";") {
break;
}
if (!vis[s]) {
bl = 0;
break;
}
v.push_back(vis[s]);
}
if (!bl) {
cout << "greska" << '\n';
continue;
}
vis[K] = id++;
cout << "ok" << '\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... |