제출 #104698

#제출 시각아이디문제언어결과실행 시간메모리
104698ShtefDijamant (COI16_dijament)C++14
27 / 100
412 ms39020 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...