// // File: regulate.cc // Author: cteam59 // // Created on November 13, 2011, 10:22 AM // #include #include #include using namespace std; struct cable{ int to; int own; }; // // // int main(int argc, char** argv) { vector conected[8010]; vector kolejka; int n,m,c,t; int fr,to,ow; int powt, pos, now, test=0; int spr[8010]; bool find= false, redunt; cable actual; for(int i=0; i<8010; i++) spr[i]=0; while(1) { //Kolejny zestaw testowy - warunek konca, czyszczenie wektorow scanf("%d %d %d %d",&n,&m, &c,&t); if(n==0 && m==0 && c==0 && t==0) break; for(int i=0; i=2) { printf("Forbidden: monopoly.\n"); break; } powt = 0; for(unsigned int k=0; k=2) { printf("Forbidden: monopoly.\n"); break; } conected[fr][j].own=ow; if(pos>=0) conected[to][pos].own=ow; printf("Sold.\n"); } break; } } if(find==false) printf("No such cable.\n"); } printf("\n"); } return 0; }