Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int n;
- int setka[200][200];
- int cord[2];
- int main()
- {
- for(int i=0;i<200;i++)
- for(int j=0;j<200;j++)
- setka[i][j]=0;
- cin>>n;
- for(int i=0;i<n;i++){
- cin>>cord[0];
- cin>>cord[1];
- setka[cord[0]+100][cord[1]+100]++;
- if (setka[cord[0]+100][cord[1]+100]==5) {
- counter(int cord[0]+100, int cord[1]+100)
- }
- int ctr = 0;
- for(int i=0;i<200;i++)
- for(int j=0;j<200;j++)
- if (setka[i][j]>0) ctr++;
- cout<<str;
- }
- return 0;
- }
- void counter(int k, int n){
- if (setka[k][n] == 5)
- {
- setka[k][n] = 0;
- setka[k + 1][n] = 0;
- counter(k + 1, n);
- setka[k][n + 1] = 0;
- counter(k, n + 1);
- setka[k - 1][n] = 0;
- counter(k - 1, n);
- setka[k][n - 1] = 0;
- counter(k, n - 1);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement