Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ///Trello, Facil, Un mural para el patio de la escuela
- #include <iostream> /// AlenAntonelli
- #include <vector>
- using namespace std;
- int main ()
- {
- int T, ph, pv;
- int nf, cd, ch;
- int nc, fd, fh;
- char P;
- cin>>T>>ph>>pv;
- cout<<endl;
- string aux (T, '.');
- vector <string> M (T, aux);
- for (int f=1; f<=ph; f++)
- {
- cin>>nf>>P>>cd>>ch;
- cout<<endl;
- for (int c=cd-1; c<ch; c++)
- {
- if (M[nf-1][c]=='.')
- M[nf-1][c]=P;
- else
- {
- if ( (M[nf-1][c]=='R' && P=='A') || (M[nf-1][c]=='A' && P=='R') )
- M[nf-1][c]='N';
- if ( (M[nf-1][c]=='R' && P=='Z') || (M[nf-1][c]=='Z' && P=='R') )
- M[nf-1][c]='P';
- if ( (M[nf-1][c]=='A' && P=='Z') || (M[nf-1][c]=='Z' && P=='A') )
- M[nf-1][c]='V';
- }
- }
- }
- cout<<endl<<endl;
- for (int c=1; c<=pv; c++)
- {
- cin>>nc>>P>>fd>>fh;
- cout<<endl;
- for (int f=fd-1; f<fh; f++)
- {
- if (M[f][nc-1]=='.')
- M[f][nc-1]=P;
- else
- {
- if ( (M[f][nc-1]=='R' && P=='A') || (M[f][nc-1]=='A' && P=='R') )
- {
- M[f][nc-1]='N';
- }
- if ( (M[f][nc-1]=='R' && P=='Z') || (M[f][nc-1]=='Z' && P=='R') )
- M[f][nc-1]='P';
- if ( (M[f][nc-1]=='A' && P=='Z') || (M[f][nc-1]=='Z' && P=='A') )
- M[f][nc-1]='V';
- }
- }
- }
- for( int i=0; i<T; i++)
- cout<<M[i]<<endl;
- return T;
- }
Advertisement
Add Comment
Please, Sign In to add comment