# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
531513 | 2022-03-01T01:01:10 Z | Register | Dijamant (COI16_dijament) | C++14 | 424 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]][v[j]]||b[v[j]][v[i]]) continue; 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
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 204 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 |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 204 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 | Correct | 3 ms | 204 KB | Output is correct |
7 | Correct | 2 ms | 204 KB | Output is correct |
8 | Correct | 1 ms | 204 KB | Output is correct |
9 | Correct | 1 ms | 204 KB | Output is correct |
10 | Correct | 1 ms | 204 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 204 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 | Correct | 3 ms | 204 KB | Output is correct |
7 | Correct | 2 ms | 204 KB | Output is correct |
8 | Correct | 1 ms | 204 KB | Output is correct |
9 | Correct | 1 ms | 204 KB | Output is correct |
10 | Correct | 1 ms | 204 KB | Output is correct |
11 | Incorrect | 1 ms | 204 KB | Output isn't correct |
12 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 424 ms | 476 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |