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 <iostream>
#include <map>
#include <vector>
using namespace std;
map <string, bool> m;
map <string, map <string, bool> > svi;
int n;
int main(){
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
cin >> n;
for(int i = 0 ; i < n ; ++i){
string s;
cin >> s;
char poc;
cin >> poc;
map <string, bool> ovaj;
while(1){
string x;
cin >> x;
if(x == ";")
break;
ovaj[x] = 1;
}
if(m.find(s) != m.end()){
cout << "greska" << endl;
continue;
}
bool p = 1;
for(map <string, bool>::iterator j = ovaj.begin() ; j != ovaj.end() ; ++j){
string x = j->first;
if(m.find(x) == m.end()){
p = 0;
break;
}
}
if(!p){
cout << "greska" << endl;
continue;
}
cout << "ok" << endl;
m[s] = 1;
svi[s] = ovaj;
}
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... |