Submission #531511

# Submission time Handle Problem Language Result Execution time Memory
531511 2022-03-01T00:58:15 Z Register Dijamant (COI16_dijament) C++14
13 / 100
138 ms 476 KB
#include <bits/stdc++.h>
using namespace std;
const int N=1005;
int tot;
map<string,int> id;
bitset<N> b[N];
void read(){
	string s;
	for(cin>>s;s!=";";cin>>s);
}
bool add(){
	string it;cin>>it;
	if(id[it]) {read();return 0;}
	string s;cin>>s;
	vector<int> v;
	for(cin>>s;s!=";";cin>>s){
		int x=id[s];
		if(!x) {read();return 0;}
		v.push_back(x);
	}
	int m=v.size();
	for(int i=0;i<m;i++) for(int j=i+1;j<m;j++) if((b[v[i]]|b[v[j]]).count()) return 0;
	id[it]=++tot;
	for(int x:v) b[tot]|=b[x],b[tot][x]=1;
	return 1;
}
int main(){
	int t;scanf("%d",&t);
	while(t--) puts(add()?"ok":"greska");
	return 0;
}

Compilation message

dijament.cpp: In function 'int main()':
dijament.cpp:28:13: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   28 |  int t;scanf("%d",&t);
      |        ~~~~~^~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 1 ms 264 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 264 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Incorrect 2 ms 204 KB Output isn't correct
7 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 264 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Incorrect 2 ms 204 KB Output isn't correct
7 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 138 ms 476 KB Output isn't correct
2 Halted 0 ms 0 KB -