Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- using namespace std;
- int main(){
- int n;
- int v[10001];
- cin >> n;
- for(int i = 0; i < n; i++){
- cin >> v[i];
- if(v[i]==0)
- cout << "0\n";
- for(int j = -n; j<n; j++){
- if(v[i]== -1 && i+j >= 0 && i+j <= n){
- v[i]=v[i+j];
- }
- if(v[i] == 0 && j > 0){
- cout << j << "\n";
- }
- if(v[i] == 0 && j < 0){
- cout << -j << "\n";
- }
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement