Cod sursa(job #75286)
Utilizator | Data | 31 iulie 2007 22:06:13 | |
---|---|---|---|
Problema | Aprindere | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.48 kb |
#include <fstream.h>
int main(){
int n,m,nrc,temp,timp=0,coord,test;
ofstream out;
ifstream in;
out.open("aprindere.out");
in.open("aprindere.in");
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();
in.close();
}