Submission #244346

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
2443462020-07-03 16:40:48MatesV13Dijamant (COI16_dijament)C++11
0 / 100
2099 ms86392 KiB
#include <bits/stdc++.h>
using namespace std;
map<string, int> imi;
vector<int> c[1005];
string ime_klase, nadklase;
int v[1005], us[1005]; bool ok;
bool dohvatljivi[1005][1005];
int n, br; queue<pair<int, int> > xx;
bool check(int idx){
while (xx.size()) xx.pop();
for (int i=0; i<c[idx].size(); i++){
bool kk=1;
for (int j=0; j<c[idx].size(); j++)
if (dohvatljivi[c[idx][i]][c[idx][j]]) kk=0;
if (kk) xx.push(make_pair(c[idx][i], c[idx][i]));
}
for (int i=1; i<br; i++) v[i]=0;
while (!xx.empty()){
int cur = (xx.front()).first;
int par = (xx.front()).second;
if (v[cur]==cur){xx.pop(); continue;}
if (v[cur] and v[cur]!=par) return 0;
v[cur]=par; xx.pop();
for (int i=0; i<c[cur].size(); i++)
xx.push(make_pair(c[cur][i], par));
} return 1;
}
int main (){
ios::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

dijament.cpp: In function 'bool check(int)':
dijament.cpp:11:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for (int i=0; i<c[idx].size(); i++){
                ~^~~~~~~~~~~~~~
dijament.cpp:13:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for (int j=0; j<c[idx].size(); j++)
                 ~^~~~~~~~~~~~~~
dijament.cpp:24:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for (int i=0; i<c[cur].size(); i++)
                 ~^~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...