report VI VI EN
Register | Login
  • HOME
  • PROBLEMSET
  • ROADMAP
  • COMPETITION
  • TOPIC
  • RANKING
  • GUIDE
  • MASHUP
  • ABOUT
  • CONTACT
  • Problem
  • Submit
  • Results
Odd - MarisaOJ: Marisa Online Judge

Odd

Time limit: 2000 ms
Memory limit: 256 MB
Given an array $A$ of $n$ integers. Count the number of contiguous subsequences such that all values in the subsequence appear an odd number of times. ### Input - The first line contains two integers $n$. - The second line contains $n$ integers $A_i$. ### Output - Print an integer, the number of subsequences that satisfy the condition. ### Constraints - $1 \le n,A_i \le 10^5$. ### Example Input: ``` 3 1 2 2 ``` Output: ``` 4 ```
Hash a set
Prefix equality
Good subarray
Brewing potion 6
Mino
Traffic system
Odd
Topic
Hashing
Rating 2100
Solution (1) Solution