Korotkodul

F

Dec 31st, 2021 (edited)
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.71 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3. #include <vector>
  4. #include <queue>
  5. #include <algorithm>
  6. #include <string>
  7. #include <stack>
  8. #include <set>
  9. #include <map>
  10. #define pii pair <int,int>
  11. using namespace std;
  12. using ll = long long;
  13. using ld = long double;
  14. void cv(vector <int> &v){
  15.     for (auto x: v) cout<<x<<' ';
  16.     cout<<"\n";
  17. }
  18.  
  19. void cvv(vector <vector <int> > &v){
  20.     for (auto x: v) cv(x);
  21.     cout<<"\n";
  22. }
  23. void cvch(vector <vector <char > > v){
  24.     for (auto x: v) {
  25.             for (auto y: x)cout<<y;
  26.             cout<<"\n";
  27.     }cout<<"\n";
  28. }
  29. vector <vector <char> > wall(5, vector <char> (30));
  30. vector <vector <char >> pattern(5, vector <char> (30, '.'));
  31. vector <pii> idx;
  32.  
  33.  
  34. bool was(vector <vector<char>> v){
  35.     for (int j = 0; j < )
  36. }
  37. int main()
  38. {
  39.     /*ios::sync_with_stdio(0);
  40.     cin.tie(0);
  41.     cout.tie(0);*/
  42.     idx = {{2, 2}, {2, 7}, {2, 12}, {2, 17}, {2, 22}, {2, 27}};
  43.     vector <pair<char, char> > clr = {{'R', 'B'}, {'B', 'R'}, {'G', 'B'}, {'R', 'G'}, {'G', 'R'}, {'B', 'G'}};
  44.     vector <int> dx, dy;
  45.     dx = {-1, -1, 0, 1, 1, 1, 0, -1};
  46.     dy  = {0, 1, 1, 1, -1, 0, -1, -1, -1};
  47.     for (int k=0;k<6;++k){
  48.         auto cr = idx[k];
  49.         int i = cr.first, j = cr.second;
  50.         pattern[i][j] = clr[k].second;
  51.         for (int t = 0;t<8;++t){
  52.             pattern[i+dx[t]][j+dy[t]] = clr[k].first;
  53.         }
  54.     }
  55.     for (int i=0;i<5;++i) for (int j=0;j<30;++j)cin>>wall[i][j];
  56.     //cvch(wall);
  57.     if (was(wall)) cout<<"Yes\n";
  58.     else {
  59.         cout<<"No\n";
  60.         cvch(pattern);
  61.     }
  62. }
  63. /*
  64. RGB....RGB...RGB..........RGB.
  65.  
  66.  
  67. WWWWRRRBRHMVEGGGIJTMKWBBBWWRRR
  68. WWWWRLORALVBZGAMGNCBXKBWWBWRGR
  69. WWWWRRRASXDCFGVRBGJNLMBBBWWRRR
  70. WWWWRWRWUERPTGEGRLWWWWBWWBWRGB
  71. WWWWRWWRWWWWWWGGGWWWWWBBBWWRGW
  72. */
  73.  
Add Comment
Please, Sign In to add comment