Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ///Trello, Principiante, Pintando la bicisenda
- #include <iostream> /// AlenAntonelli
- #include <vector>
- using namespace std;
- int main ()
- {
- int B=0, t=0, p, f, e, i;
- char c;
- cin >> B >> t;
- vector <char> v (B, '.');
- for (e=0; e<t; e++)//for Externo que recorre todas los tramos
- {
- cin >> p >> f >> c;
- for (i=p-1; i<f; i++) //for Interno que recorre los espacios en los que se asigna o reasigna un color
- {
- if (v[i]=='.')//si no hay color le asigno el que tengo
- v[i]=c;
- if ((v[i]=='R' && c=='A') || (v[i]=='A' && c=='R'))
- v[i]='N';///formo el narana
- if ((v[i]=='R' && c=='Z') || (v[i]=='Z' && c=='R'))
- v[i]='P';///formo el narana
- if ((v[i]=='Z' && c=='A') || (v[i]=='A' && c=='Z'))
- v[i]='V';///formo el narana
- if ( (v[i]=='N' && c=='Z') || (v[i]=='P' && c=='A') || (v[i]=='V' && c=='R') )
- v[i]='M';///formo el narana
- }
- }
- for (i=0; i<B; i++)
- cout << v[i];
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment