Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- using namespace std;
- long long n=0,wynik=0,pom=0;
- long long tab[1000011];
- int main()
- {
- ios_base::sync_with_stdio(0);
- cin>>n;
- for(int i=0;i<n;i++)
- {
- cin>>tab[i];
- }
- for(int i=0;i<n;i++)
- {
- if(tab[i]==0)
- {
- pom++;
- }
- else wynik+=pom;
- }
- cout<<wynik<<endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement