fork download
  1. #include<bits/stdc++.h>
  2. //using namespace gnu_pbds;
  3. using namespace std;
  4.  
  5. #define ff first
  6. #define ss second
  7. #define int long long
  8. #define pb push_back
  9. #define mp make_pair
  10. #define pii pair<int,int>
  11. #define vi vector<int>
  12. #define mii map<int,int>
  13. #define pqb priority_queue<int>
  14. #define pqs priority_queue<int,vi,greater<int> >
  15. #define setbits(x) builtin_popcountll(x)
  16. #define zrobits(x) __builtin_ctzll(x)
  17. #define mod 1000000007
  18. #define inf 1e18
  19. #define ps(x,y) fixed<<setprecision(y)<<x
  20. #define mk(arr,n,type) type arr=new type[n];
  21. #define w(x) int x; cin>>x; while(x--)
  22. mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
  23.  
  24. //typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;
  25.  
  26.  
  27. void c_a_r()
  28. {
  29. ios_base::sync_with_stdio(0);
  30. cin.tie(0);
  31. cout.tie(0);
  32. #ifndef ONLINE_JUDGE
  33. freopen("input.txt", "r", stdin);
  34. freopen("output.txt", "w", stdout);
  35. #endif
  36. }
  37.  
  38.  
  39. void solve()
  40. {
  41.  
  42. w(t)
  43. {
  44.  
  45. loop(i, 1, n + 1)
  46. {
  47. loop(j, 1, m + 1)
  48. {
  49. if (a[i][j] == ' ' || a[i][j] == '#')
  50. {
  51. if (i > K)
  52. {
  53. ll u = 0;
  54. bool ok = 1, ok2 = 0;
  55. for (ll k = i - 1; ((k >= 1) && (j - u - 1) >= 1 && (j + u + 1) <= m);
  56. k--)
  57. {
  58. if (!((a[k][j - u - 1] == '*' || a[k][j - u - 1] == '#') &&
  59. (a[k][j + u + 1] == '*' || a[k][j + u + 1] == '#')))
  60. {
  61. ok = 0;
  62. break;
  63. }
  64. ok2 = 1;
  65. u++;
  66. }
  67. if (ok && ok2 && u >= K)
  68. {
  69. ll uu = 0;
  70. a[i][j] = '#';
  71. for (ll k = i - 1; uu < u && k >= 1; k--)
  72. {
  73. if (a[k][j - uu - 1] == '.' a[k][j + uu + 1] == '.') break;
  74. a[k][j - uu - 1] = '#';
  75. a[k][j + uu + 1] = '#';
  76. uu++;
  77. }
  78. }
  79. }
  80. }
  81. }
  82. }
  83.  
  84. }
  85. }
  86. int32_t main()
  87. {
  88. c_a_r();
  89.  
  90. solve();
  91.  
  92. }
  93.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘void solve()’:
prog.cpp:45:14: error: ‘i’ was not declared in this scope
         loop(i, 1, n + 1)
              ^
prog.cpp:45:20: error: ‘n’ was not declared in this scope
         loop(i, 1, n + 1)
                    ^
prog.cpp:45:9: error: ‘loop’ was not declared in this scope
         loop(i, 1, n + 1)
         ^~~~
prog.cpp:45:9: note: suggested alternative: ‘logl’
         loop(i, 1, n + 1)
         ^~~~
         logl
stdout
Standard output is empty