Cod sursa(job #75289)
| Utilizator | Data | 31 iulie 2007 22:57:40 | |
|---|---|---|---|
| Problema | Aprindere | Scor | 0 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.45 kb |
#include <fstream.h>
int main(){
int n,m,nrc,temp,timp=0,coord,test;
ofstream out;
ifstream in("aprindere.in");
out.open("aprindere.out");
in >>n>>m;
int camera[n];
for(int i=0;i<n;i++)
in >>camera[i];
for(int i=0;i<m;i++){
test=0;
in >>nrc;
in >>temp;
in >>nrc;
for(int p=0;p<nrc;p++){
in >>coord;
if(camera[coord]==0){
camera[coord]=1;
test=1;
}
}
if(test==1 || nrc==1)
timp=temp+timp;
}
out <<timp;
out.close();
}
