MCPcopy Create free account
hub / github.com/Vishruth-S/CompetitiveCode / main

Function main

HackerEarth_problems/Subarrays XOR/Solution.cpp:124–149  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

122 return ans;
123}
124int main()
125{
126 int n,p=0,t,k;
127 cin>>t;
128 while(t--)
129 {
130 p=0;
131 cin>>n>>k;
132 int arr[n];
133 for(int i=0;i<n;i++)
134 {
135 cin>>arr[i];
136 }
137 trienode* head=new trienode();
138 insert(0,head);
139 long long int ans=0;
140 for(int i=0;i<n;i++)
141 {
142 p=p^arr[i];
143 ans+=find_max_xor(head,p,k);
144 insert(p,head);
145 }
146 cout<<ans<<endl;
147 }
148 return 0;
149}
150
151

Callers

nothing calls this directly

Calls 2

find_max_xorFunction · 0.85
insertFunction · 0.70

Tested by

no test coverage detected