A Simple Minus

View as PDF

Submit solution

Points: 10
Time limit: 0.05s
Memory limit: 2M

Authors:
Problem type
Allowed languages
Assembly

Your computer engineering instructor decided to ramp things up a bit (in terms of difficulty, of course) with this next task:

Write a program to find the maximum difference between the XOR of adjacent elements of a given array.

More formally,

Given an array A, find the maximum value of (A[i]A[i+1])(A[j]A[j+1]) for some i and j, where ij.

Unimpressed by the supposed "challenge", you open up your favourite text editor and begin typing away... in assembly.

Input Specification

The first line of input will contain a single integer N (3N100).

The second line of input will contain N space-separated integers in the range [103,103], denoting the contents of array A.

Output Specification

The desired integer value as defined by your teacher on a line by itself.

Sample Input

Copy
3
3 2 1

Sample Output

Copy
2

Explanation

We can find the maximum value when i=2 and j=1:

(A[2]A[3])(A[1]A[2])=(21)(32)=2

Note

To use libc in NASM, the first line of your program should be ; libc. For all others, it should be ; features: libc.


Comments


  • -2
    _ryan6_  commented on June 21, 2022, 1:29 p.m.

    Are you serious bro? Is this "easy"? I can't even understand the words in the question :C