Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- long[] a = new long[10];
- long[][] a = new long[10][];
- long[][]...[] a = new long[10][]...[];
- int[][][][][][][][][][][][][][][][]
- [][][][][][][][][][][][][][][][]
- [][][][][][][][][][][][][][][][]
- [][][][][][][][][][][][][][][][]
- [][][][][][][][][][][][][][][][]
- [][][][][][][][][][][][][][][][]
- [][][][][][][][][][][][][][][][]
- [][][][][][][][][][][][][][][][]
- [][][][][][][][][][][][][][][][]
- [][][][][][][][][][][][][][][][]
- [][][][][][][][][][][][][][][][]
- [][][][][][][][][][][][][][][][]
- [][][][][][][][][][][][][][][][]
- [][][][][][][][][][][][][][][][]
- [][][][][][][][][][][][][][][][]
- [][][][][][][][][][][][][][][][] array;
- error: array type has too many dimensions
- [][][][][][][][][][][][][][][][] array;
- ^
- int[] array = new int [Integer.MAX_VALUE - 5];
- public class SuperLongArray {
- private static int MASK = Integer.MAX_VALUE - 5;
- int[] left = new int [Integer.MAX_VALUE - 5];
- int[] right = new int [Integer.MAX_VALUE - 5];
- public int put(long address, int value) {
- if(address & MASK > 0) {//если значение указателя больше чем максимальное значение, то мы записывает его в левый массив
- int pointer = address - MASK;
- left[address] = value;
- } else {
- right[address] = value;
- }
- }
- public int get(long address) {
- if(address & MASK > 0) {
- int pointer = address - MASK;
- return left[address];
- } else {
- return right[address];
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement