Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7871399
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T01:53:45+00:00 2026-06-03T01:53:45+00:00

Input is a boolean array a_0,i with at most 1000,000 elements. each time the

  • 0

Input is a boolean array a_0,i with at most 1000,000 elements.

each time the new array is made by xor of adjacent(cyclic) elements in previous array:

a_t,i = a_t-1,i ^ a_t-1,(i+1)%n     // n is size of input

The p-th array(a_p,i) is wanted.(p <= 1000,000,000).

According to high bound on p I think maybe there is a structure of arrays or maybe the array can be calculated in O(lg(p) * n).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T01:53:46+00:00Added an answer on June 3, 2026 at 1:53 am

    If t is a power of two (t=2k),

    a_t,i = a_0,i ^ a_0,(i+t)%n
    

    Also, if t is a sum of two components, and one of them is a power of two (t = v + w, w=2m),

    a_t,i = a_v,i ^ a_v,(i+w)%n
    

    This allows using binary representation of p to recursively compute the resulting array. The complexity is as requested: O(lg(p) * n):

    shift = 1;
    while (p != 0)
    {
      if (p&1)
        a ^= a.rotate(shift);
      shift *= 2
      p /= 2
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So basically, I have one array, with ten values... int[] input = new int[10];
public static boolean palindrome(String input, int i, int j) { if (i >= j)
Input rz value In the head I have: Event.observe(window, 'load', function() { $$(input).each(function(field){ Event.observe(field,
I need to filter an array to remove the elements that are lower than
I'm looking to process this array of dates and an essentially boolean single value:
This is a cellular automata rule (input Boolean == Left, Center, Right Cell) and
I'm trying to implement a program that involves an array of stacks. Each stack
In IE8 this input.attr(name,exam.exam_Normal[' +normal_id_unique + '].boolean_v); Outputs this only in IE8.... <input propdescname=exam.exam_Normal['1'].boolean_v
Input @StartDate = '01/25/2010' @EndDate = '02/06/2010' I have 2 CTEs in a stored
Input : {5, 13, 6, 5, 13, 7, 8, 6, 5} Output : {5,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.