Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(i<K && leftyes==false && (mas[i][0]==1 || mas[i][1]==1))
- {
- left=i;
- leftyes=true;
- ls=mas[i][0]+mas[i][1];
- }
- if(i>=K && (mas[i][0]==1 || mas[i][1]==1))
- {
- right=i;
- rightyes=true;
- rs=mas[i][0]+mas[i][1];
- }
- i++;
- }
- boolean leftfirst=false,rightfirst=false,justleft=false,justright=false;
- if(leftyes && rightyes)
- {
- if(K-left==right-K)
- {
- if(ls>=rs)
- {
- leftfirst=true;
- }
- else
- {
- rightfirst=true;
- }
- }
- else
- if(K-left<right-K)
- {
- leftfirst=true;
- }
- else
- {
- rightfirst=true;
- }
- }
- else
- if(leftyes)
- {
- justleft=true;
- }
- else
- if(rightyes)
- {
- justright=true;
- }
- else
- {
- t=0;
- }
- if(leftfirst)
- {
- for(i=K;i>=left;i--)
- {
- if(mas[i][0]==1)
- {
- s--;
- }
- if(mas[i][1]==1)
- {
- s--;
- }
- }
- t=(K-left)*2;
- }
- else
- if(rightfirst)
- {
- for(i=K;i<=right;i++)
- {
- if(mas[i][0]==1)
- {
- s--;
- }
- if(mas[i][1]==1)
- {
- s--;
- }
- }
- t=(right-K)*2;
- }
- else
- if(justleft || rightfirst)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement